medenagan / window-corner-preview

GNOME Shell extension showing a video preview on the corner of the screen
https://extensions.gnome.org/extension/1227/window-corner-preview/
MIT License
135 stars 26 forks source link

Not compatible with Gnome 3.32 #14

Open GreyAsteroid opened 5 years ago

GreyAsteroid commented 5 years ago

Describe the bug This extension does not work on Gnome 3.32

To Reproduce Steps to reproduce the behavior:

  1. Use Gnome 3.32

Expected behavior It to work.

medenagan commented 5 years ago

Hello,

there is some issue with

var PopupSliderMenuItem = new Lang.Class({
    Name: "WindowCornerPreview.PopupSliderMenuItem",
    Extends: PopupMenu.PopupBaseMenuItem,

Which extends the PopupBaseMenuItem class defined in popupMenu.js

The error is provoked by some changes in the GNOME shell api (maybe the switch from Lang classes to ES6 syntax?) but at the moment I don't have a clear idea of what's going on and how to easy fix it, sorry

EDIT:

It seems confirmed that a Lang class cannot inherit from a new ES6 class. WCP does use this approach, as such will break.

Porting to ES6 classes has the potential to break extensions (as it's not possible to use Lang.Class to inherit from ES6 classes).

Prepare for porting to ES6 classes

medenagan commented 5 years ago

Ok guys, it seems only this class for now it's affected.

If you run GNOME 3.32: you can clone the repo, checkout the feat-ES6-porting branch and replace the ~/.local/share/gnome-shell/extensions/window-corner-preview@fabiomereu.it folder with a symbolic link to your local repo subfolder.

jtojnar commented 5 years ago

:+1: I tried the branch on NixOS and most things seem to be working:

No JavaScript errors in the journal.

Mikuana commented 5 years ago

Ok guys, it seems only this class for now it's affected.

If you run GNOME 3.32: you can clone the repo, checkout the feat-ES6-porting branch and replace the ~/.local/share/gnome-shell/extensions/window-corner-preview@fabiomereu.it folder with a symbolic link to your local repo subfolder.

Instructions for fix work exactly as described for PopOS 19.04, which is running on Gnome 3.32.

jsj1027 commented 5 years ago

Is this fix going to be merged into the main branch at any point soon?

MasterGeekMX commented 5 years ago

Ok guys, it seems only this class for now it's affected.

If you run GNOME 3.32: you can clone the repo, checkout the feat-ES6-porting branch and replace the ~/.local/share/gnome-shell/extensions/window-corner-preview@fabiomereu.it folder with a symbolic link to your local repo subfolder.

Tried on Fedora 30 Workstation. Didn't worked.

jtojnar commented 5 years ago

Tried on Fedora 30 Workstation. Didn't worked.

What does that mean? The extension does not show up on the panel or it does and some menu items do not carry out the expected action? Do you see any errors in system journal after you enable the extension?

medenagan commented 5 years ago

Is this fix going to be merged into the main branch at any point soon?

Hi, this fix will break back compatibility (GNOME < 3.32) because class keyword could not be used on gjs before that.

Also, some users are still having errors with this fix on their distros. Once stabler distros switch to GNOME 3.32 and wider feedback is available the experimental branch will be merged.

EDIT: just to be clearer, older gjs versions will trigger a compiling error as they detect any class keyword on uncommented lines, so you can't put it on a conditional either. Other GNOME shell classes have been wrapped up by the official team, so that older extensions can temporarily rely on the deprecated Lang.class way.

virat-kumar commented 5 years ago

Ok guys, it seems only this class for now it's affected.

If you run GNOME 3.32: you can clone the repo, checkout the feat-ES6-porting branch and replace the ~/.local/share/gnome-shell/extensions/window-corner-preview@fabiomereu.it folder with a symbolic link to your local repo subfolder.

I am using GNOME 3.32.2 on Manjaro disto I git clone the feat-ES6-porting branch Placed the folder in ~/.local/share/gnome-shell/extensions/ sadly, still dosen't wonk. Any other way of fixing it ?

jgierer12 commented 5 years ago

@vk001716 have you restarted the GNOME shell? You need to do that in order for the extension to show up in GNOME Tweaks and then enable it there.

jonnyeom commented 5 years ago

On the latest Manjaro stable build with Gnome 3.32.2, This branch works for me.

@vk001716 I think what you may have dont is placed the entire repo in the directory. Once you clone the code and switch to the feat-ES6 branch, there is a subdirectory called window-corner-preview@fabiomereu.it inside it. That is what should go to or link to in ~/.local/share/gnome-shell/extensions/.

e.g.

cd ~/project (or wherever you want to keep the project)
git clone https://github.com/medenagan/window-corner-preview.git .
git checkout -t origin/feat-ES6-porting
ln -s ~/project/window-corner-preview/window-corner-preview@fabiomereu.it ~/.local/share/gnome-shell/extensions/ (Swap out ~/project to wherever you put it)

Jonathan

paulbauriegel commented 5 years ago

@jonnyeom following you guide is still get an exception:

Extension "window-corner-preview@fabiomereu.it" had error: TypeError: this._construct is not a function
jonnyeom commented 5 years ago

@paulbauriegel Where are you seeing this error? Perhaps you need to restart gnome? (Alt+F2 to open dialog and enter r to restart)

paulbauriegel commented 5 years ago

Did that already, but still getting a error when loading the extension. Setting work for some reason. I'm seeing the Error in Alt+F2 -> lg, but no stacktrace unfortunately.

jak commented 5 years ago

I've packaged the ES6 branch here to simplify installation until a better option is found https://extensions.gnome.org/extension/1937/window-corner-preview-332/

paulbauriegel commented 5 years ago

@jak Tried to install that extension, but I'm getting an exception during installation: Extension "window-corner-preview@jak.io" had error: Error: Type name Gjs_WindowCornerPreview_indicator is already registered

medenagan commented 5 years ago

It seems you have two distinct instances of the extension running at the same time, please make sure the older one gets disabled

Inviato da iPhone

Il giorno 12 ago 2019, alle ore 12:58, Paul Bauriegel notifications@github.com ha scritto:

@jak Tried to install that extension, but I'm getting an exception during installation: Extension "window-corner-preview@jak.io" had error: Error: Type name Gjs_WindowCornerPreview_indicator is already registered

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.