komorebi icon indicating copy to clipboard operation
komorebi copied to clipboard

[FEAT]: Remember a window's workspace and monitor when the monitor configuration is changed

Open edgimar opened this issue 5 months ago • 0 comments

I'm not sure if this is a feature or a bug, but I would expect Komorebi to keep track of the (monitor, workspace) pair that each window is assigned to (possibly in a way that persists across restarts of Komorebi). Then when a monitor reconfiguration occurs, Komorebi should ensure that each window that matches the last known (monitor, workspace, window) tuple is moved to the correct monitor and workspace.

As it is, I need to restart Komorebi and manually place windows every time I undock and re-dock my laptop (the dock adds two additional monitors). This is also the case when I hibernate and resume, if I have switched to a different dock (also having two slightly different monitors).

If detecting such monitor changes is not possible to do automatically, it would still be helpful to have a command to manually move all windows to the last known (monitor, workspace) associated with them.

Perhaps one complication is how to keep track of these associations when the number of monitors decreases. A model like the following might make sense here: each workspace (and its windows) is associated with a monitor, and when that monitor goes away, the workspace is moved to one of the remaining monitors. When the monitor becomes available again, then the workspace can be moved back to that monitor (so you'd need to keep track of what monitor the workspace was previously on -- some kind of stack?).

edgimar avatar Sep 06 '24 14:09 edgimar