Behavior when adding/removing displays, windows being moved between workspaces

Hello all!

I was forwarded here from the GNOME reddit with an issue I’m having with workspaces being combined when display configuration changes. I hope its OK If I just copypasta my post here below…


TLDR: I don’t want GNOME automatically rearranging my windows between workspaces when displays are added and removed.

Background: I’m a heavy user of workspaces, so I often have windows on 5 or more workspaces. I have two external displays attached to the dock, of which I sometimes use both, and sometimes use the other for another computer. Sometimes I have one external display and the laptop display. I don’t believe I’ve ever used three displays.

I have workspaces set to be only on primary.

Problem: When the display configuration changes (one is removed), GNOME likes to move windows to other workspace, sometimes combining all windows on to one workspace. I haven’t completely narrowed down what the algorithm is. It seems that if I go from two displays to one, the windows on the two visible workspaces combine into one. Sometimes all windows from all workspaces combine onto one workspace, I feel like this mostly happens when I disconnect from the dock. It is quite frustrating when my window arrangement gets destroyed.

Combining all windows onto one also happens when I add a monitor which becomes the primary. This happens for example when docking the laptop and the newly added external display becomes the primary display for GNOME. In my use, this also happens often when I switch my main display between computers.

Question: Is there a setting or other way to alter behavior (extension?), so that GNOME keeps workspaces intact when display configuration changes, rather than combining workspaces? Essentially what I want is for windows to always stay on their assigned workspaces unless I explicitly move them.

Thoughts: My thoughts on what the behavior should be when out of two displays, one is disconnected:

For “Multiple workspaces only on primary”:

  • When primary display is disconnected
    • Workspace from old primary gets put into workspace stack
    • Workspace on old secondary stays visible on new primary
  • When secondary is disconnected
    • Workspace from old secondary gets added to workspace stack
    • Workspace from old primary stays visible
  • When display is added and it becomes the primary
    • Windows/workspace on old primary stay there
    • New primary starts as an empty workspace
    • Windows on hidden workspaces on old primary stay grouped on their workspaces, which are now available on the new primary.
  • Display is added and it becomes secondary
    • New secondary display starts empty
    • Primary stays as it is

For “workspaces span displays” its harder to say, since the two workspaces are “pairs” in a way. Here combining the pairs might make sense, though interleaving workspaces from both displays into one stack without combining windows from the two displays could make sense as well. I would probably prefer the second.

The dream: There is one stack of workspaces that is shared between displays. I can switch any workspace to any desktop. PaperWM handles this in a nice way for example.


I haven’t yet done much systematic testing, but I think the scenarios I have when removing a display:

  • When secondary display is removed: The two visible workspaces on two displays get combined into one when secondary display is disconnected, and workspaces in the background stay as they are.
  • When primary display is removed: All workspaces get combined onto one workspace on the remaining display.

I haven’t yet tested this, but thinking back to experiences, I think there is another scenario I’ve had:

  • Laptop is docked, newly connected external display becomes primary display. All windows are combined onto one workspace.

It seems like GNOME is prioritizing keeping windows on the same display, at the cost of combining workspaces to avoid moving windows to a different display? I’ll do some more systematic tests if needed, when I have better time.

P.S.: I know my dream of switching workspaces independently on each monitor is not in the plans, but I’ll voice my vote for it anyway :wink:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.