I am not sure whether this is a bug or a problem with my misunderstanding of frames in EXWM, so I hope one of the wizards here can shed some light on the issue.
When I do (setq my-win-config (current-window-configuration)) and later (set-window-configuration my-win-config), the state of the frame is restored correctly, provided all the X windows that were displayed at the time of saving are still alive. However, if I focus a different screen and call (set-window-configuration my-win-config t), odd things happen.
To see this behaviour, connect two screens with each only one workspace on them, say screens A and B. Open an X window on screen A, focus it, and save the window configuration.
Scenario 1: While the X window is still visible on screen A, focus screen B and load the window configuration. The X window moves to screen B, which is expected. This scenario is good.
Scenario 2: Change the window configuration on screen A to display something totally different, not including your X window. Then focus screen B. Load the window configuration. Your X window pops up on screen B as expected, but at the same time, the window configuration on screen A changes to something else, often *scratch*. This is the scenario that vexes me, because I would expect screen A to not change at all. I also cannot figure out by which logic screen A chooses what to display at this point. It is not the window configuration that was on screen B at the time of either function call.
If you have a third screen connected, that one is entirely unaffected. The odd behaviour only happens on the screen where the window configuration was originally saved.
I can work around this by wrapping each call to set-window-configuration to iterate over all my workspaces, save their respective states, set the window configuration, then restore all other workspaces to their prior state, but I would still like to know what is happening here.
Edit: I keep using org syntax.
I am not sure whether this is a bug or a problem with my misunderstanding of frames in EXWM, so I hope one of the wizards here can shed some light on the issue.
When I do
(setq my-win-config (current-window-configuration))and later(set-window-configuration my-win-config), the state of the frame is restored correctly, provided all the X windows that were displayed at the time of saving are still alive. However, if I focus a different screen and call(set-window-configuration my-win-config t), odd things happen.To see this behaviour, connect two screens with each only one workspace on them, say screens A and B. Open an X window on screen A, focus it, and save the window configuration.
Scenario 1: While the X window is still visible on screen A, focus screen B and load the window configuration. The X window moves to screen B, which is expected. This scenario is good.
Scenario 2: Change the window configuration on screen A to display something totally different, not including your X window. Then focus screen B. Load the window configuration. Your X window pops up on screen B as expected, but at the same time, the window configuration on screen A changes to something else, often
*scratch*. This is the scenario that vexes me, because I would expect screen A to not change at all. I also cannot figure out by which logic screen A chooses what to display at this point. It is not the window configuration that was on screen B at the time of either function call.If you have a third screen connected, that one is entirely unaffected. The odd behaviour only happens on the screen where the window configuration was originally saved.
I can work around this by wrapping each call to
set-window-configurationto iterate over all my workspaces, save their respective states, set the window configuration, then restore all other workspaces to their prior state, but I would still like to know what is happening here.Edit: I keep using org syntax.