Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switching from multi-monitor to single-monitor makes windows immovable #43

Open
frodew opened this issue Jul 25, 2023 · 8 comments
Open
Labels
bug Something isn't working workaround available The user can work around this manually

Comments

@frodew
Copy link

frodew commented Jul 25, 2023

First of, thank you so much for this extension - I really enjoy it!
The only issue I encountered is that it seems to have problems in multi-screen setups, i.e., when powering off a system with one monitor attached to a laptop and rebooting without this external monitor, several screen-glitches occur. These seem to differ, with sometimes windows being immovable and other times constantly 'sliding/switching' between or within workspaces. The result is that the system becomes unusable and it is sometimes even hard to turn off the extension, as there is constant movement. After turning off the extension, however, the system continues to work like expected.
It does seem to make a difference whether I unplug the external monitor before shutting down the system. Unfortunately, I cannot test the issue with another laptop/monitor setup.

I am using Fedora 38 with Wayland on my laptop which I is often connected to a second monitor.

@khimaros
Copy link
Owner

thank you for the report. this may be related to #31

does the issue remain after the monitor has been plugged back in? have you found a way to correct the issue other than resetting the extension state entirely?

@frodew
Copy link
Author

frodew commented Aug 1, 2023

Yes, the issue remains after the monitor has been plugged in again. The only workaround I have found so far is to disable the plugin before unplugging and enable it again if the second monitor is connected. This way, unfortunately, I cannot really use the plugin 'just' on my laptop. To reset the extension, I normally delete all saved windows.

Here is a dump of my current config, maybe it helps:

dconf dump /org/gnome/shell/extensions/smart-auto-move/                                                                                                                       [14:14:49]
[/]
activate-workspace=true
debug-logging=false
freeze-saves=false
ignore-position=false
ignore-workspace=false
match-threshold=0.69999999999999996
overrides='{"geary":[{"action":1,"threshold":0.7}],"Slack":[{"threshold":0.75,"action":1}],"com.cisco.anyconnect.gui":[{"threshold":0.7,"action":1}],"com.lakoliu.Furtherance":[{"threshold":0.2999999999999998,"action":1}],"Alacritty":[{"threshold":0.7,"action":1}],"firefox":[{"action":1,"threshold":0.5499999999999998}],"zoom":[{"action":1,"threshold":0.7}],"Spotify":[{"action":1,"threshold":0.7}],"teams-for-linux":[{"action":1,"threshold":0.7}],"org.gnome.Nautilus":[{"action":1,"threshold":0.7}],"obsidian":[{"action":1,"threshold":0.7}],"Zotero":[{"threshold":0.7,"action":1}],"Google-chrome":[{"action":1,"threshold":0.7}],"ONLYOFFICE Desktop Editors":[{"action":1,"threshold":0.7}]}'
save-frequency=2000
saved-windows='{"zoom":[{"id":2793017673,"hash":2793017673,"sequence":92,"title":"Zoom - Licensed Account","workspace":5,"maximized":0,"fullscreen":false,"above":false,"monitor":1,"x":2319,"y":100,"width":376,"height":517,"occupied":true}],"com.cisco.anyconnect.gui":[{"id":2793017584,"hash":2793017584,"sequence":3,"title":"Cisco AnyConnect Secure Mobility Client","workspace":5,"maximized":0,"fullscreen":false,"above":false,"monitor":1,"x":2062,"y":643,"width":475,"height":493,"occupied":true}],"Zotero":[{"id":2793017590,"hash":2793017590,"sequence":9,"title":"data_donation - Zotero","workspace":3,"maximized":3,"fullscreen":false,"above":false,"monitor":1,"x":1920,"y":26,"width":1920,"height":1174,"occupied":true}],"Spotify":[{"id":2793017587,"hash":2793017587,"sequence":6,"title":"Spotify","workspace":5,"maximized":2,"fullscreen":false,"above":false,"monitor":1,"x":2719,"y":26,"width":1117,"height":1174,"occupied":true}],"com.lakoliu.Furtherance":[{"id":2793017586,"hash":2793017586,"sequence":5,"title":"Furtherance","workspace":5,"maximized":0,"fullscreen":false,"above":false,"monitor":1,"x":1933,"y":57,"width":360,"height":375,"occupied":true}],"Signal":[{"id":2793017691,"hash":2793017691,"sequence":110,"title":"Signal","workspace":4,"maximized":2,"fullscreen":false,"above":false,"monitor":1,"x":2880,"y":26,"width":960,"height":1174,"occupied":false}],"Slack":[{"id":2793017594,"hash":2793017594,"sequence":13,"title":"Slack/XXX","workspace":4,"maximized":2,"fullscreen":false,"above":false,"monitor":1,"x":2880,"y":26,"width":960,"height":1174,"occupied":true}],"geary":[{"id":2793017651,"hash":2793017651,"sequence":70,"title":"Inbox — XXX","workspace":4,"maximized":2,"fullscreen":false,"above":false,"monitor":1,"x":1920,"y":26,"width":960,"height":1174,"occupied":true}],"firefox":[{"id":2793017588,"hash":2793017588,"sequence":7,"title":"bad extension state makes windows immovable (jumping back to previously saved position) · Issue #31 · khimaros/smart-auto-move — Mozilla Firefox","workspace":0,"maximized":3,"fullscreen":false,"above":false,"monitor":0,"x":0,"y":540,"width":1920,"height":1080,"occupied":true}],"Alacritty":[{"id":2793017582,"hash":2793017582,"sequence":1,"title":"Alacritty","workspace":0,"maximized":3,"fullscreen":false,"above":false,"monitor":1,"x":1920,"y":26,"width":1920,"height":1174,"occupied":true}],"org.gnome.Software":[{"id":2793017735,"hash":2793017735,"sequence":154,"title":"Software","workspace":4,"maximized":0,"fullscreen":false,"above":false,"monitor":1,"x":2280,"y":213,"width":1200,"height":800,"occupied":false}],"ONLYOFFICE Desktop Editors":[{"id":2793017742,"hash":2793017742,"sequence":161,"title":"ONLYOFFICE Desktop Editors","workspace":2,"maximized":3,"fullscreen":false,"above":false,"monitor":1,"x":1920,"y":26,"width":1920,"height":1174,"occupied":true}],"com.mattjakeman.ExtensionManager":[{"id":2793017743,"hash":2793017743,"sequence":162,"title":"Extension Manager","workspace":2,"maximized":0,"fullscreen":false,"above":false,"monitor":1,"x":2480,"y":313,"width":800,"height":600,"occupied":false}]}'
startup-delay=2500
sync-frequency=1000
sync-mode='IGNORE'

@tmahmood
Copy link

tmahmood commented Aug 4, 2023

I think this issue exists with any multi-monitor setup. Becomes unusable. I am not able to use it. It would be great if fixed.

@khimaros khimaros added the bug Something isn't working label Aug 4, 2023
@khimaros
Copy link
Owner

khimaros commented Aug 4, 2023

i would like to fix

to do that, i need some help: i am on the road and currently do not have access to an external monitor. if someone could help me come up with a minimal reproduction, that would help a lot.

the steps would be as follows:

  1. close all open windows
  2. disable the extension: gnome-extensions disable smart-auto-move@khimaros.com
  3. clear the settings: dconf reset /org/gnome/shell/extensions/smart-auto-move/
  4. enable the extension: gnome-extensions enable smart-auto-move@khimaros.com
  5. open a single (wayland) application window (gnome-terminal works well for this)
  6. attach your external monitor and move the window to where you'd like it, ideally everything is still working correctly at this point
  7. dump your configuration dconf dump /org/gnome/shell/extensions/smart-auto-move/
  8. attach/detach the monitor, move the window around, log out and in, etc. as needed to reproduce the issue. in all cases, stick to the same single application window
  9. dump your configuration dconf dump /org/gnome/shell/extensions/smart-auto-move/
  10. write out the steps taken in this issue and include all config dumps you captured

if you provide this, i will do my best to come up with a fix.

@tmahmood
Copy link

tmahmood commented Aug 4, 2023

Okay, I have reinstalled the extension just now, so it's going to take some time for me to provide anything. Once I start to get the error, I will do the steps you mentioned.

@khimaros khimaros changed the title Bug with varying multi-monitor setup switching from multi-monitor to single-monitor makes windows immovable Aug 21, 2023
@frodew
Copy link
Author

frodew commented Aug 31, 2023

I did the steps, however, I was unable to reproduce the "constantly moving workspace" error. Instead, the shell crashed and foced me to log in again with all extensions disabled. Here is a short example:

  1. Open the gnome terminal on external monitor.
[xxx@xxx ~]$ dconf dump /org/gnome/shell/extensions/smart-auto-move/
[/]
activate-workspace=true
debug-logging=false
freeze-saves=false
ignore-position=false
ignore-workspace=false
match-threshold=0.69999999999999996
overrides='{}'
save-frequency=1000
saved-windows='{"gnome-terminal-server":[{"id":1128693284,"hash":1128693284,"sequence":516,"title":"xxx@xxx:~","workspace":1,"maximized":0,"fullscreen":false,"above":false,"monitor":1,"x":2629,"y":175,"width":1176,"height":763,"occupied":true}]}'
startup-delay=2500
sync-frequency=100
sync-mode='RESTORE'
  1. Power off the system. Unplug external monitor.
  2. Power on the system. Shell opens with all extensions disabled.
  3. Enable extensions through browser and start gnome-terminal.
  4. The shell crashes and logs me out.
  5. Logging in again (extensions are all diabled now) and opening the terminal gives me the following config-dump:
[xxx@xxx ~]$ dconf dump /org/gnome/shell/extensions/smart-auto-move/
[/]
activate-workspace=true
debug-logging=false
freeze-saves=false
ignore-position=false
ignore-workspace=false
match-threshold=0.69999999999999996
overrides='{}'
save-frequency=1000
saved-windows='{"gnome-terminal-server":[{"id":3453462702,"hash":3453462702,"sequence":2,"title":"xxx@xxx:~","workspace":1,"maximized":0,"fullscreen":false,"above":false,"monitor":1,"x":2629,"y":175,"width":1176,"height":763,"occupied":true}],"com.mattjakeman.ExtensionManager":[{"id":3453462701,"hash":3453462701,"sequence":1,"title":"Extension Manager","workspace":0,"maximized":0,"fullscreen":false,"above":false,"monitor":0,"x":560,"y":519,"width":800,"height":600,"occupied":false}]}'
startup-delay=2500
sync-frequency=100
sync-mode='RESTORE'
  1. Repeating enabling the extension leads (again) to crash. After 3 times, the shell starts to change colors every 2 seconds, seemingly blinking between two different sets.

I don't know whether this helps. For now, my workaround is to disable the extension before powering down the system if I intend to unplug the second monitor. This issue seems connected/similar to #41 .

@khimaros khimaros pinned this issue Apr 18, 2024
@khimaros
Copy link
Owner

FYI, no progress on fix but i believe i now have a way to reproduce this.

@khimaros
Copy link
Owner

khimaros commented Apr 18, 2024

WORKAROUND AVAILABLE i've found that if a specific window is exhibiting this behavior, you can open the "Saved Windows" preferences tab for smart-auto-move and "DELETE" any instances of that application. after doing this, it seems to return to normal behavior.

@khimaros khimaros added the workaround available The user can work around this manually label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workaround available The user can work around this manually
Projects
None yet
Development

No branches or pull requests

3 participants