zakkak / workspace-grid

https://extensions.gnome.org/extension/484/workspace-grid/
GNU General Public License v3.0
288 stars 40 forks source link

[Bug] Extension broken in Gnome 3.30+ #86

Closed mandulaj closed 5 years ago

mandulaj commented 6 years ago

Summary: The extension workspace-grid fails to load in Gnome 3.30.

Steps to Reproduce: Update gnome to version 3.30 or higher and enable the extension workspace grid.

Expected Results: Workspace-grid loads successfully.

Actual Results: The extension crashes with the following error: gnome-shell[1379]: Extension "workspace-grid@mathematical.coffee.gmail.com" had error: TypeError: global.screen is undefined


More Info: Reports indicate 3.29 not working however this was not tested with workspace-grid.

The probable cause is an API change in Gnome 3.29. Other extensions experience similar issues : https://github.com/home-sweet-gnome/dash-to-panel/issues/434 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905108 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905110 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905107

TheBlackKoala commented 6 years ago

I would like to add the note that i tried the 3.30 branch and when i didn't replace the prefs-file it made the system crash on login and when i did it made everything quite messed up. (running Arch - gnome 3.30)

ebeem commented 6 years ago

me too, crashed with branch 3.30 on gnome 3.30 - Arch

mrmoss commented 6 years ago

I've been playing around with this - simply changing out global.screen with global.workspace_manager and global.display (in their respected new placements in 3.30) doesn't fix the issue:

Attempting to remove actor of type 'ShellGenericContainer' from group of class 'StWidget', but the container is not the actor's parent.
Object St.Bin (0x55eb059e0300), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.

Stack trace:
extension.js:976
extension.js:966
extension.js:1073
extension.js:1311

I'm pretty novice to shell extension development, so hopefully that helps someone out there...putting in log('...'); and print('...'); doesn't seem to go to journalctl for me...

The only global.screen. that I didn't replace with global.workspace_manager. was global.screen.clear_mouse_mode(); in extension.js (changed to global.display.clear_mouse_mode();).

Edit: Attached diff. changes.zip

mehtaphysical commented 6 years ago

Works for me. What I did:

rm -rf ~/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com
git checkout 3.30
make zip
mv workspace-grid@mathematical.coffee.gmail.com.zip ~/.local/share/gnome-shell/extensions
cd ~/.local/share/gnome-shell/extensions
unzip workspace-grid@mathematical.coffee.gmail.com.zip
gnome-shell-extension-tool --disable-extension workspace-grid@mathematical.coffee.gmail.com

Then restarted gnome and turned on the extension from tweak-tools.

It would probably also work with linking the workspace-grid@mathematical.coffee.gmail.com directory to your extensions directory and running make all. The key, I think, is to run gnome-shell-extension-tool --disable-extension workspace-grid@mathematical.coffee.gmail.com before restarting gnome.

Also, if you merge the 3.28 branch into the 3.30 branch you can probably do:

rm -rf ~/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com
make install
gnome-shell-extension-tool --disable-extension workspace-grid@mathematical.coffee.gmail.com

Hope that helps.

mrmoss commented 6 years ago

I didn't realize I was on the wrong branch (derp).

I followed your steps exactly. As soon as I activate the extension, the menus start to glitch, the screen eventually goes to black, and the only way I can recover is to either go to a ctrl+alt+f2 and reboot.

andersjohansson commented 6 years ago

For me it seems to work to merge the 3.28 and 3.30 branches like this: https://github.com/andersjohansson/workspace-grid/tree/3.30fix, and then installing it as @mehtaphysical suggests. I have no knowledge of how these extensions work however so I can’t vouch for the sense in this exact merge.

ebeem commented 6 years ago

@mehtaphysical thanks, it worked after following your suggestion and disabling the extension my gratitude

TheBlackKoala commented 6 years ago

@mehtaphysical it works although gnome-tweaks shows it as off - also the animation is solely as if going down and the size of the grid it shows is different in the first column to all the others. A major bug in it is that is doesn't show the grid in the workspace overview so it is rather difficult to move windows to other desktops. But it works so thank you very much!

logankoester commented 6 years ago

Yep, exactly the same experience here.

Installing @andersjohansson's 3.30fix branch with @mehtaphysical's instructions and I'm back in business... except the missing overview grid as @TheBlackKoala noted is rather important for window placement.

TheBlackKoala commented 6 years ago

Aaaand it makes gnome crash once you restart it...

thijzert commented 6 years ago

I've submitted issue #88 for the direction being off and #89 for the missing overview pane so we can focus on Gnome crashing in this one.

logankoester commented 6 years ago

Ha, yeah... just moments after submitting my comment I fell into the gnome crash loop until I disabled the extension again. :panda_face:

TheBlackKoala commented 6 years ago

I've already submitted a seperate one for the crash :)

zakkak commented 5 years ago

All, since I don't have access to gnome 3.30 yet (ubuntu 18.04 user) I cannot test nor fix the extension for 3.30. I have rebased the 3.30 branch on 3.28 so you can get the latest changes in both branches (including make install for easier experimentation)

Please paste logs (from journalctl /usr/bin/gnome-shell -f) along with your reports and if you manage to get a fix please open a PR.

seeruk commented 5 years ago

This is by no means a fix overall, but I have been able to use this extension without it crashing by commenting out line 1361 in extension.js (that's the line overrideWorkspaceDisplay(); which appears to be linked to how the overview is displayed. I just get the default overview when I do this which does work properly, but doesn't look like a grid. I still have to navigate it like a grid.

Maybe this will help people use the extension temporarily until there's a real solution.

The popup overlay when you change workspace still works fine for me.

mrmoss commented 5 years ago

Did a fresh clone, let it crash after a fresh reboot, here's my log output:

gnome-shell[1865]: Some code accessed the property 'MAX_THUMBNAIL_SCALE' on the module 'workspaceThumbnail'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway.
gnome-shell[1865]: Object St.Bin, has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
org.gnome.Shell.desktop[1865]: == Stack trace for context 0x55e4a6e0f1e0 ==
org.gnome.Shell.desktop[1865]: #0   i   /home/user/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:1019
org.gnome.Shell.desktop[1865]: #1   i   /home/user/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:1009
org.gnome.Shell.desktop[1865]: #2   i   /home/user/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:1116
org.gnome.Shell.desktop[1865]: #3   i   /home/user/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com/extension.js:1361
org.gnome.Shell.desktop[1865]: #4   i   resource:///org/gnome/shell/ui/extensionSystem.js:135
org.gnome.Shell.desktop[1865]: #5   i   resource:///org/gnome/shell/ui/extensionSystem.js:181
org.gnome.Shell.desktop[1865]: #6   i   resource:///org/gnome/shell/ui/extensionSystem.js:328
org.gnome.Shell.desktop[1865]: #7   b   resource:///org/gnome/gjs/modules/signals.js:128
org.gnome.Shell.desktop[1865]: #8   i   resource:///org/gnome/shell/misc/extensionUtils.js:186
org.gnome.Shell.desktop[1865]: #9   b   resource:///org/gnome/gjs/modules/_legacy.js:82
org.gnome.Shell.desktop[1865]: #10  i   resource:///org/gnome/shell/misc/extensionUtils.js:192
org.gnome.Shell.desktop[1865]: #11  b   resource:///org/gnome/shell/misc/fileUtils.js:27
org.gnome.Shell.desktop[1865]: #12  i   resource:///org/gnome/shell/misc/extensionUtils.js:191
org.gnome.Shell.desktop[1865]: #13  b   resource:///org/gnome/gjs/modules/_legacy.js:82
org.gnome.Shell.desktop[1865]: #14  i   resource:///org/gnome/shell/ui/extensionSystem.js:330
org.gnome.Shell.desktop[1865]: #15  i   resource:///org/gnome/shell/ui/extensionSystem.js:338
org.gnome.Shell.desktop[1865]: #16  i   resource:///org/gnome/shell/ui/extensionSystem.js:369
org.gnome.Shell.desktop[1865]: #17  i   resource:///org/gnome/shell/ui/extensionSystem.js:377
org.gnome.Shell.desktop[1865]: #18  i   resource:///org/gnome/shell/ui/main.js:229
org.gnome.Shell.desktop[1865]: #19  i   resource:///org/gnome/shell/ui/main.js:133
org.gnome.Shell.desktop[1865]: #20  i   <main>:1
gnome-shell[1865]: Script <main> terminated with an uncatchable exception
gnome-shell[1865]: Execution of main.js threw exception: Script <main> terminated with an uncatchable exception
seeruk commented 5 years ago

Note line 1361 in the above stack trace for that temporary fix.

felipemarinho97 commented 5 years ago

Maybe something in ThumbnailsBox changed in 3.30 version and we are monkey patching or trying to access some variable or method that doesn't exists anymore.

zakkak commented 5 years ago

The above stack traces are present in 3.28 as well.

I believe the issue is in _replaceThumbnailsBoxActor.

First https://github.com/zakkak/workspace-grid/blob/3.30/workspace-grid%40mathematical.coffee.gmail.com/extension.js#L1006 it destroys the actor (and it's children AFAIK) but then https://github.com/zakkak/workspace-grid/blob/3.30/workspace-grid%40mathematical.coffee.gmail.com/extension.js#L1019 uses the _indicator and _dropPlaceholder actors which used to be associated with the now destroyed actor.

I don't understand how to fix this though. I tried using the actors from patch, but didn't do the trick. Anyone with a better understanding of the actors model, please enlighten us :)

gofish commented 5 years ago

Based on that @zakkak, I tried a shot in the dark and it seems to be working (based on branch 3.28, as I am also on 18.04):

diff --git a/workspace-grid@mathematical.coffee.gmail.com/extension.js b/workspace-grid@mathematical.coffee.gmail.com/extension.js
index f9af74d..4679219 100644
--- a/workspace-grid@mathematical.coffee.gmail.com/extension.js
+++ b/workspace-grid@mathematical.coffee.gmail.com/extension.js
@@ -960,6 +960,8 @@ function _replaceThumbnailsBoxActor (actorCallbackObject) {

     // kill the old actor
     slider.actor.remove_actor(thumbnailsBox.actor);
+    thumbnailsBox.actor.remove_actor(thumbnailsBox._indicator);
+    thumbnailsBox.actor.remove_actor(thumbnailsBox._dropPlaceholder);
     thumbnailsBox.actor.destroy();

     // make our own actor and slot it in to the existing thumbnailsBox.actor

FYI I also noticed an NPE when accessing global overrides settings, which may be NULL.

@@ -1164,7 +1166,9 @@ function unoverrideWorkspaceDisplay() {
 *******************/
 function disableDynamicWorkspaces() {
     let settings = global.get_overrides_settings();
-    settings.set_boolean('dynamic-workspaces', false);
+    if (settings) {
+           settings.set_boolean('dynamic-workspaces', false);
+    }
 }

 /******************
zakkak commented 5 years ago

@gofish that's great. I am going to try the changes but please open a PR so you get the credit if it indeed solves the issue.

thijzert commented 5 years ago

I rebased the patch by @gofish on the 3.3.0 branch and opened a PR. It seems to fix a few issues at once.

logankoester commented 5 years ago

@thijzeet That's encouraging news! Man, the last couple of weeks have been almost unbearable without this extension.

ebeem commented 5 years ago

@thijzert thanks!! it works now .. still needs some debugging tho looks like the extension started to lose track of current workspace sometimes glad that I can use it again anyway .. thank you so much

zakkak commented 5 years ago

Please try the latest 3.30 branch and see if it fixes this issue.

Thank you all for your contributions :tada:

thijzert commented 5 years ago

Yes, it's working again. Thanks everyone!

zakkak commented 5 years ago

I uploaded the latest version on extensions.gnome.org, pending approval!

thebitstick commented 5 years ago

How long does it take for approval?

zakkak commented 5 years ago

It depends on the reviewers, it is not fixed. You can however get the latest version from this repo if you don't want to wait.

On Fri, Oct 5, 2018, 20:49 TheBitStick notifications@github.com wrote:

How long does it take for approval?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/zakkak/workspace-grid/issues/86#issuecomment-427446612, or mute the thread https://github.com/notifications/unsubscribe-auth/ABXnA7agrHze5Ou2IdyqCYyAuIqWEDv2ks5uh5uagaJpZM4Wt011 .

c0r0n3r commented 5 years ago

Workspace always scrolled vertically independently from the fact that the previous and the current workspace are beside each other. Earlier it worked well.

TheBlackKoala commented 5 years ago

@c0r0n3r see issue #88

kfrncs commented 5 years ago

It depends on the reviewers, it is not fixed. You can however get the latest version from this repo if you don't want to wait. On Fri, Oct 5, 2018, 20:49 TheBitStick @.***> wrote: How long does it take for approval? — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <#86 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ABXnA7agrHze5Ou2IdyqCYyAuIqWEDv2ks5uh5uagaJpZM4Wt011 .

thanks for this. can't figure out how to manually install in Manjaro though. There's no "install extension" button or similar in gnome-tweaks

ebeem commented 5 years ago

@kfrncs you don't need manual ... you can install directly from here https://extensions.gnome.org/extension/484/workspace-grid/

however, if you insist ... you need to move the files on the src folder to /home/****/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com

after that, restart your close your gnome-tweaks and open it again.

mrmoss commented 5 years ago

@kfrncs If that doesn't work for you, you can also:

git clone https://github.com/zakkak/workspace-grid.git
cd workspace-grid
make install
gnome-shell-extension-tool -e workspace-grid@mathematical.coffee.gmail.com