domferr / tilingshell

Extend Gnome Shell with advanced tiling window management. Supports multiple monitors, Windows 11 Snap Assistant, Fancy Zones, customised tiling layouts and more.
https://extensions.gnome.org/extension/7065/tiling-shell/
GNU General Public License v2.0
284 stars 4 forks source link

Layouts are deleted after unlocking PC #78

Closed in4matix closed 1 week ago

in4matix commented 1 week ago

Layouts are gone after unlocking Ubuntu 22.04, ST version 11

domferr commented 1 week ago

Hey, thank you for reporting this bug! So, after logging out and logging back in, you have no layouts? Can you share how to reproduce the problem?

domferr commented 1 week ago

Oh, maybe you are referring to what happens when a monitor is disconnected and connected back? If you disconnect a monitor, the extension forgets about the selected layout at the moment. Let me know if you are talking about this, thank you !

in4matix commented 1 week ago

Can you share how to reproduce the problem?

1.Select "Lock" from menu.

  1. PC locks and displays time.
  2. Log-in
  3. Layouts are gone.
  4. Restart PC, layouts are back.

Screenshot from 2024-07-08 15-28-40

in4matix commented 1 week ago

I tried to replicate this after the reboot, and the issue seems to have fixed itself.

gozes commented 1 week ago

@domferr Yup I just had this happen to me. I don't tend to remove my machine all that often. usually, once a week. so it would be great if there was a way to fix this without a reboot. reinstalling the extension did not do anything. I still don't have any layouts. same with trying to reset the layout to default on the extension settings. using this steps is what causes the bug

1.Select "Lock" from menu. 2. PC locks and displays time. 3. Log-in 4. Layouts are gone.

maybe this issue needs to be reopened.

in4matix commented 1 week ago

I spoke too soon. It just did it again.

gozes commented 1 week ago

@in4matix so to clarify the bug will show up every time you lock the session?

gianmarcotoso commented 1 week ago

It happens after the latest mutter update, when resuming after locking the PC.

domferr commented 1 week ago

@gianmarcotoso can you share a bit more about this mutter update? It may be very useful for me, so I can understand whether it is a Tiling Shell problem or a Mutter one. Thank you!

@gozes thank you for sharing, which version of GNOME do you have? Thank you!

gianmarcotoso commented 1 week ago

@domferr It was more that I've upgraded my system and the only thing that caught my eye as Gnome-related was mutter, but looking at pacman logs I can see that it was it was just an upgrade from 46.3 to 46.3.1 and the changelog does not give many clues. They merged these two MRs: !3862 and !2959, I don't know if it helps.

I'm looking at other updated packages but I don't see something that could impact a Gnome extension, but I admit I don't know enough about Gnome extensions to determine which one could be the culprit.

Edit: I just noticed you released v11 with per-monitor layouts, maybe the issue is somewhere in there instead? I can't find the PR for the release, which commits are relevant to this feature?

domferr commented 1 week ago

@gianmarcotoso thank you!

This is the commit related to v11. To summarize:

I have some questions:

Currently I'm running Ubuntu 23.04 (GNOME Shell 44) and I'm not able to reproduce the problem, so your help would be invaluable!

gozes commented 1 week ago

@gianmarcotoso can you share a bit more about this mutter update? It may be very useful for me, so I can understand whether it is a Tiling Shell problem or a Mutter one. Thank you!

@gozes thank you for sharing, which version of GNOME do you have? Thank you!

@domferr I'm on Fedora 40 which currently runs gnome 46

gozes commented 1 week ago

@gianmarcotoso thank you!

This is the commit related to v11. To summarize:

  • the changes about per-monitor layouts are only UI related (the feature itself was there, behind the scenes, since first version of Tiling Shell).
  • in version 11, I changed how the indicator draws the layout buttons

I have some questions:

  • when the bug arises, do you have zero layouts everywhere (snap assistant is empty, it is not possible to use the tiling system) or the problem affects the indicator only (the layout buttons are not shown when clicking on the indicator) ?
  • when the bug arises, are there any error logs? You can check it via journalctl -b /usr/bin/gnome-shell -n 300 --no-pager, which will print the last 300 logged events of GNOME shell (and extensions too). It works even after a reboot

Currently I'm running Ubuntu 23.04 (GNOME Shell 44) and I'm not able to reproduce the problem, so your help would be invaluable!

For me I have zero layouts after unlocking my PC. I can hit edit and add layouts if I wanted but the original 4 layouts are gone

gianmarcotoso commented 1 week ago

@domferr I don't have the snap assistant enabled, so I couldn't test it when it last happened, but there were no layouts at all when opening the panel menu. I have only one monitor. Also, attempting do disable and re-enable the extension, an error appeared in the extension manager besides the extension, and going into the journal I can indeed see something that can help pinpoint the issue:

Object St.BoxLayout (0x57a1f5529ef0), has been already disposed — 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 for context 0x57a1f0f9a880 ==
                                            #0   7fff3d2398c0 b   resource:///org/gnome/shell/ui/layout.js:992 (22044b9de510 @ 32)
                                            #1   57a1f1062568 i   resource:///org/gnome/shell/ui/layout.js:999 (22044b9de560 @ 26)
                                            #2   57a1f10624c8 i   file:///home/gianmarcotoso/.local/share/gnome-shell/extensions/tilingshell@ferrarodomenico.com/extension.js:2868 (283cd1bbb3d0 @ 66)
                                            #3   57a1f1062438 i   resource:///org/gnome/shell/ui/layout.js:613 (22044b9dcb00 @ 127)
                                            #4   57a1f10623a8 i   resource:///org/gnome/shell/ui/init.js:21 (22044b970bf0 @ 48)

This repeats for some times, but I suspect it's because I've tried to toggle the extension multiple times. However, the nature of the error makes me suspicious as you shouldn't have to worry about memory allocation with JS and objects captured in a closure should not be reapead by a garbage collector pass if the closure itself is still referenced. Does this help?

gianmarcotoso commented 1 week ago

I've found another one that's much more interesting:

Object St.BoxLayout (0x57a1f5529ef0), has been already disposed — 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 for context 0x57a1f0f9a880 ==
                                            #0   57a1f10626b8 i   file:///home/gianmarcotoso/.local/share/gnome-shell/extensions/tilingshell@ferrarodomenico.com/extension.js:2780 (283cd1bbad30 @ 487)
                                            #1   57a1f10625f8 i   file:///home/gianmarcotoso/.local/share/gnome-shell/extensions/tilingshell@ferrarodomenico.com/extension.js:2944 (283cd1bbb6f0 @ 94)
                                            #2   7fff3d2398c0 b   self-hosted:221 (22044b9709c0 @ 267)
                                            #3   57a1f1062568 i   file:///home/gianmarcotoso/.local/share/gnome-shell/extensions/tilingshell@ferrarodomenico.com/extension.js:2942 (283cd1bbb6a0 @ 133)
                                            #4   57a1f10624c8 i   file:///home/gianmarcotoso/.local/share/gnome-shell/extensions/tilingshell@ferrarodomenico.com/extension.js:2873 (283cd1bbb3d0 @ 248)
                                            #5   57a1f1062438 i   resource:///org/gnome/shell/ui/layout.js:613 (22044b9dcb00 @ 127)
                                            #6   57a1f10623a8 i   resource:///org/gnome/shell/ui/init.js:21 (22044b970bf0 @ 48)

At first glance it appears that the _container of the DefaultMenu is getting destroyed?

Then we also get

Object St.BoxLayout (0x57a1f5529ef0), has been already disposed — 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 for context 0x57a1f0f9a880 ==
                                            #0   7fff3d2398c0 b   file:///home/gianmarcotoso/.local/share/gnome-shell/extensions/tilingshell@ferrarodomenico.com/extension.js:68 (283cd1bb20b0 @ 28)
                                            #1   57a1f1062568 i   file:///home/gianmarcotoso/.local/share/gnome-shell/extensions/tilingshell@ferrarodomenico.com/extension.js:2910 (283cd1bbb560 @ 27)
                                            #2   57a1f10624c8 i   file:///home/gianmarcotoso/.local/share/gnome-shell/extensions/tilingshell@ferrarodomenico.com/extension.js:2871 (283cd1bbb3d0 @ 192)
                                            #3   57a1f1062438 i   resource:///org/gnome/shell/ui/layout.js:613 (22044b9dcb00 @ 127)
                                            #4   57a1f10623a8 i   resource:///org/gnome/shell/ui/init.js:21 (22044b970bf0 @ 48)

Which, again, seems to crash when attempting to access a _container passed as a parameter. :thinking:

domferr commented 1 week ago

Oh that's very interesting, thanks a million! That gave me an idea to what the problem may be (and why it doesn't happen all the time). I'm leaving here an updated version with a possible bugfix to this problem. However, I'm still trying to reproduce the problem without success, so please consider that I'm just guessing :smiling_face_with_tear:, I'm not so confident that this will solve the problem, but you will tell me!

Meanwhile, I try to reproduce the problem on my side

gianmarcotoso commented 1 week ago

Thank you, I'll give it a try tomorrow!

in4matix commented 1 week ago

@domferr , not sure if this is of any help, but this did not happen with TS version 10.

domferr commented 1 week ago

@domferr , not sure if this is of any help, but this did not happen with TS version 10.

Yeah, it is, thank you! Let me know, if you can, if the bugfix is working!

mrantillies commented 1 week ago

@domferr , not sure if this is of any help, but this did not happen with TS version 10.

Yeah, it is, thank you! Let me know, if you can, if the bugfix is working!

Looks to me like the bugfix is working, will test throughout the day and let you know if not.

domferr commented 1 week ago

@mrantillies that's great! Thank you :partying_face:

gianmarcotoso commented 1 week ago

@domferr I can confirm that so far it seems to be working correctly, even after a couple of resumes from sleep! Thank you!

mrantillies commented 1 week ago

@mrantillies that's great! Thank you 🥳

I've had numerous locks and unlocks today now, and it's all working well again.

domferr commented 1 week ago

Woohooo, thank you guys! I'm going to publish this update, and I'll close this issue as soon as the update gets reviewed and accepted

domferr commented 1 week ago

They just accepted the update! :partying_face: You can already update!