wilfm / GnomeExtensionMaximusTwo

Removes the title bar on maximised windows. See: https://extensions.gnome.org/extension/844/maximus-two/
63 stars 27 forks source link

Not compatible with Gnome 3.24 #55

Open ikuraj opened 7 years ago

ikuraj commented 7 years ago

The extension does not work with Gnome 3.24. (On Arch Linux, package gnome-shell 3.24.1+2+g45c2627d4-1.) It seems that updating the version in metadata.json cannot help either. The extensions throws the following error:

gnome-shell[638]: JS ERROR: Exception in callback for signal: extension-found: TypeError: redeclaration of let i
                                                 @/usr/share/gnome-shell/extensions/maximus-two@wilfinitlike.gmail.com/extension.js:50:7
                                                 initExtension@resource:///org/gnome/shell/ui/extensionSystem.js:221:5
                                                 loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:168:18
                                                 _loadExtensions/<@resource:///org/gnome/shell/ui/extensionSystem.js:304:9
                                                 _emit@resource:///org/gnome/gjs/modules/signals.js:126:27
                                                 ExtensionFinder<._loadExtension@resource:///org/gnome/shell/misc/extensionUtils.js:184:9
                                                 wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                                 bind/<@resource:///org/gnome/gjs/modules/lang.js:95:16
                                                 collectFromDatadirs@resource:///org/gnome/shell/misc/fileUtils.js:27:1
                                                 ExtensionFinder<.scanExtensions@resource:///org/gnome/shell/misc/extensionUtils.js:189:9
                                                 wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                                 _loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:306:5
                                                 enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:314:9
                                                 _sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:345:9
                                                 init@resource:///org/gnome/shell/ui/extensionSystem.js:353:5
                                                 _initializeUI@resource:///org/gnome/shell/ui/main.js:219:5
                                                 start@resource:///org/gnome/shell/ui/main.js:127:5
                                                 @<main>:1:31

It seems GJS was updated, as reported here; gjs changelog.

Can the extension be easily fixed, i.e. modified to accommodate these changes? If not, is it possible for the author to describe how the extension works, so that the community (including myself) can step in and try to make the extension work?

diaevd commented 7 years ago

Author is unavailable for us :(. You can fix it easily by yourself. Unfortunately I do not have gnome 3.24 to do this myself.

ikuraj commented 7 years ago

I see. I am indeed a programmer so that sounds quite plausible; I would be happy to fix this. However, I have no knowledge about the Gnome framework and how this extension achieves its effect (thus the question I asked at the end in the previous message). (I am also pretty bad with Javascript, but I guess that's would be a minor issue.)

Do you have any suggestions? More specifically, about how the extension works (useful also for some sort of documentation), what needs to be changed, etc.

DuBistKomisch commented 6 years ago

I'm not familiar with GNOME development either, but managed to fix it in #57, since it was just a simple JS error (something I am unfortunately familiar with).

Until the maintainer updates the extensions page, you can just:

git clone https://github.com/DuBistKomisch/GnomeExtensionMaximusTwo
cd GnomeExtensionMaximusTwo
git checkout fix/let-i
cp -r maximus-two\@wilfinitlike.gmail.com/ ~/.local/share/gnome-shell/extensions/

and restart GNOME.

P.S. From what I've read, the version in the metadata.json isn't checked nowadays so it won't make a difference.

ikuraj commented 6 years ago

Interestingly enough, after installing the version with your fix, the tweak tool reports "Error loading extension" while the extension seems to be working properly (removing the title bar).

Moreover, there are some errors in the log (from journalctl), which are appearing repeatedly:

gnome-shell[585]: JS WARNING: [/usr/share/gnome-shell/extensions/maximus-two@wilfinitlike.gmail.com/decoration.js 153]: assignment to undeclared variable pid
gnome-shell[585]: JS WARNING: [/usr/share/gnome-shell/extensions/maximus-two@wilfinitlike.gmail.com/decoration.js 153]: assignment to undeclared variable success
gnome-shell[585]: [maximus-two]: Can't find original state for avant-window-navigator with id 0x2c00004

gnome-shell[582]: Extension "maximus-two@wilfinitlike.gmail.com" had error: Error: No signal 'maximize' on object 'ShellWM'
gnome-shell[582]: gsignal.c:2641: instance '0x5642f7da79a0' has no handler with id '188312'
gnome-shell[582]: Attempting to remove actor of type 'StLabel' from group of class 'ShellGenericContainer', but the container is not the actor's parent.

Not sure if the last two are related to the extension though.

The error (during loading) is probably this one:

gnome-shell[598]: JS ERROR: Exception in callback for signal: extension-found: TypeError: redeclaration of let i
                                                 @/usr/share/gnome-shell/extensions/maximus-two@wilfinitlike.gmail.com/extension.js:50:7
                                                 initExtension@resource:///org/gnome/shell/ui/extensionSystem.js:221:5
                                                 loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:168:18
                                                 _loadExtensions/<@resource:///org/gnome/shell/ui/extensionSystem.js:312:9
                                                 _emit@resource:///org/gnome/gjs/modules/signals.js:126:27
                                                 ExtensionFinder<._loadExtension@resource:///org/gnome/shell/misc/extensionUtils.js:184:9
                                                 wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                                 bind/<@resource:///org/gnome/gjs/modules/lang.js:95:16
                                                 collectFromDatadirs@resource:///org/gnome/shell/misc/fileUtils.js:27:1
                                                 ExtensionFinder<.scanExtensions@resource:///org/gnome/shell/misc/extensionUtils.js:189:9
                                                 wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22
                                                 _loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:314:5
                                                 enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:322:9
                                                 _sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:353:9
                                                 init@resource:///org/gnome/shell/ui/extensionSystem.js:361:5
                                                 _initializeUI@resource:///org/gnome/shell/ui/main.js:219:5
                                                 start@resource:///org/gnome/shell/ui/main.js:127:5
                                                 @<main>:1:31
DuBistKomisch commented 6 years ago

I didn't notice that since it seemed to work fine, but you're right, I also get:

gnome-shell[719]: Extension "maximus-two@wilfinitlike.gmail.com" had error: Error: No signal 'maximize' on object 'ShellWM'
gnome-shell[719]: [maximus-two]: Can't find original state for gnome-shell with id 0x40000b
gnome-shell[719]: JS WARNING: [/home/jake/.local/share/gnome-shell/extensions/maximus-two@wilfinitlike.gmail.com/decoration.js 153]: assignment to undeclared variable success            
gnome-shell[719]: JS WARNING: [/home/jake/.local/share/gnome-shell/extensions/maximus-two@wilfinitlike.gmail.com/decoration.js 153]: assignment to undeclared variable pid

I've added a fix for the last two JS warnings on my branch/PR, but I don't think they make a difference.

I think "can't find previous state" is normal operation.

The first one is probably what's causing the error to show up, seems like there's no maximize signal according to the docs, as used here. I don't think I know enough to fix this and it seems to function fine anyway, but you can probably just comment it out if you want to get rid of the error state.

That big error is the one I already fixed, you're probably looking at logs for an old session (given the different pid).

DuBistKomisch commented 6 years ago

After a little digging, looks like they replaced the maximize signal with size-changed since 3.18. Seems like it's covered in https://github.com/wilfm/GnomeExtensionMaximusTwo/issues/42 and even has a fixed branch already, just need someone to merge all the fixes together! I'll open a PR with my fixes on @danielkza's fork I guess.

In the mean time I've merged them all together into master on my fork, so you can use that.

ikuraj commented 6 years ago

I see. Sounds good. You are right, looks like it's time to merge.

diaevd commented 6 years ago

@ivankuraj - because i'm upgraded to 3.26 i'm fix my local repo for extention https://github.com/diaevd/GnomeExtensionMaximusTwo - it's workin for me

ikuraj commented 6 years ago

Thanks. It's indeed working fine now. (Installed from your repo @diaevd.) It would be great to somehow consolidate and merge these.

diaevd commented 6 years ago

@ivankuraj - my repo always is actualy while i'm upgrade my shell first what i do - fix code ;) but author is unavailable and we can't merge fixes to main repo :(

diaevd commented 6 years ago

@ivankuraj - we can publish our version on shell extentions. you can link with me by email (diaevd at gmail.com) if you think that this makes sense

diaevd commented 5 years ago

I published fix for support 3.30