mzur/gnome-shell-wsmatrix

Windows change workspaces after suspend

HadiModarres opened this issue · 24 comments

This extension is very nice, but there is a problem that makes it unusable for me. After waking up from suspend window positions change.

To reproduce: create a 3x3 matrix and open a terminal in bottom right corner, suspend then terminal position is changed.

ebeem commented

can you explain what position changes?
do you mean the window moves to another workspace?
or the window moves to another monitor?
or just position on the screen?

Hi @ebeem
yes the window moves to another workspace, I tried it many times and thats the case, haven't tried with different monitors

ebeem commented

I will need to debug this, as far as I am concerned, it didn't happen to me before. I use 3x3 grid.
I will try this and let you know

Cool :)

mzur commented

@HadiModarres Do you use a laptop with an external monitor? There might be a delay in setting up the external monitor which pushes the windows back to the workspaces of the internal monitor. I believe this issue is not caused by Workspace Matrix because it has nothing to do with window positioning. It might only increase the visibility of this issue with the 2D grid and static number of workspaces.

Hi @mzur
Yes I have my laptop connected to a single external monitor. I tested many times, and what you said is in fact true. The problem isnt there when I only work with laptop screen. Thats unfortunate, because it would be so good for me to dedicate each row to one my tasks, it just fits my workflow so well. So theres nothing that can be done? I'd be happy to help if you point me in the right direction

@mzur just to be clear, external monitor doesnt cause an issue on its own. I can work with it with no problems and detach and attach the hdmi cable many times. The issue happens only when I suspend the laptop and wake it up again.

actually, I can't reproduce it anymore, it works well with laptop or external monitor. It may have been caused by a conflict with another extension. I'll close this now, Ill open it again if I find it.

Thanks @mzur @ebeem

I don't use an external monitor and can replicate this issue
When I lock screen, whatever was in focus will be moved to the bottom left corner of a 2x2 workspace matrix

Actually it appears to only move the bottom from right to left, neither of the items in 1 or 2 move see below

1,2
3,4

1 has app, 2 has app
3 is empty, 4 has app

Lock screen

  1. has app (no change), 2 has app (no change)
    3 has app, 4 is empty

you're right, I'm seeing this behaviour too
there is something wrong with handling of empty of workspaces after attaching to external monitor or locking/suspending

mzur commented

I still can't reproduce this with Ubuntu 18.04 and GNOME 3.28.3 or Ubuntu 19.04 and GNOME 3.32.0. Which Linux distro and GNOME version do you have?

ebeem commented

@s3than
what about restarting gnome (alt+f2 and type r)? does it move the windows?
do you use other extensions that can affect this?

I use the Auto Move Windows extension which allows me to set a default workspace for each application, if I set firefox default workspace to 3 and then move it to 4, then restart/suspend/add monitor, the window will move back to workspace 3.
could it be that you have a similar scenario like this one?

can you try placing multiple windows on each workspace and tell us whether all windows at workspace#4 move to workspace#3?

@ebeem I don't have any extensions for moving windows
@mzur I'm running ubuntu 19.04, GNOME Shell 3.32.0 (ubuntu mode)

I'm having a hard time replicating again after that first day.

I'll continue testing and advise.

Could it be because of the first install and it gets fixed after a restart?

@HadiModarres That's possible, I'll keep testing I've got two laptops with the same versions installed so I can try and replicate on them at the same time

mzur commented

Please reopen if this is still relevant.

I'm experiencing this issue. 3x2 grid and I'm running the latest Manjaro with GNOME 3.32.

On mine, all of the windows on workspaces 4-6 move to workspace 3.

I think this is Gnome/Xorg issue, I don't have the plugin installed currently but I see this problem sometimes. It happens every once in a while with a mixture of external screen and suspending.
Thought this would help you in the right direction.

Haven't encountered the problem on Wayland so far.

mzur commented

So this also happens if Workspace Matrix is not installed/disabled? @FOSSforlife Can you confirm this?

ebeem commented

I made some assumptions and tested wsmatrix, it looks like disabling/enabling the extension (which happens on suspend and when gnome becomes idle for a long time) resets old configuration (without wsmatrix) and then overrides it with wsmatrix's configuration.

in case someone has let's say 6 workspaces by default, and 9 with wsmatrix, all windows from workspaces 7, 8, and 9 will move to workspace 6, since the default configuration will be restored and gnome will have to relocate windows on workspaces that do not exist anymore.

I am not sure whether this should be fixed in wsmatrix or not, I think the current behavior makes sense. a workaround to fix this issue is to set workspaces to static and number of workspace to the number u desire.

steps:

  1. go to gnome tweaks, and disable wsmatrix
  2. from gnome tweaks, go to workspaces, select the option Static Workspaces and set the Number of Workspaces (must be the same number as wsmatrix's workspaces)
  3. enable wsmatrix

if anyone is facing this issue, please try this solution and let us know if it works.

mzur commented

Thanks a lot @ebeem! This makes sense and I can reproduce the behavior. One thing we could do is to not restore the number of workspaces if the extension is disabled. This should at least solve the issue if the workspaces were set to "static". I'll have to test what happens in case they were set to "dynamic".

ebeem commented

I assume dynamic is fine since it will not get rid of the extra workspaces
and yes, I agree with not restoring the number of workspaces as a solution. Changing the number of workspaces in wsmatrix should also change gnome's number of workspaces.

@ebeem's solution worked for me. When I went to Tweaks -> Workspaces, it said that I had 6 workspaces, which is the amount I should have, but after turning off Workspace Matrix extension it went down to 3. Turning the extension off, changing it, and then turning it back on worked. Thank you all for your help!

mzur commented

I just published v2.3.0 which resolves this issue if workspaces were set to "static". If they were set to "dynamic", windows will still jump around. I'll leave it at that for now.