mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[BUG]: Monitor indexes are not stable #151
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @maxbane on GitHub (Oct 24, 2022).
Describe the bug
My physical display layout is as shown below (from Windows Display Settings):
I want the portrait-oriented monitor to use the "rows" layout algorithm, and everything else to use "bsp". So, as a first-time user, I did some experimenting with
komorebic query focused-monitor-indexto determine what Komorebi's index was for each monitor, and wrote my config like so:However, this has been unstable. After turning monitors off/on, or disconnecting the laptop from its dock and reconnecting, or sometimes even after simply restarting the computer, I find that the portrait monitor now has "bsp" layout and one of the other monitors (apparently random) has "rows" layout. When this happens,
komorebic query focused-monitor-indexindeed confirms that the indexes have all gotten scrambled. I can fix it temporarily by editing my config to use the new indexes, but inevitably they eventually get scrambled again.Note that even though the indexes get scrambled, Komorebi seems to retain correct awareness of the spatial relationships between monitors, i.e., moving windows up/down/left/right across monitor boundaries still functions correctly and as expected.
To Reproduce
See above.
Expected behavior
There should be some kind of stable way to refer to monitors when using configuration commands. Some ideas:
querycommand could be used to retrieve the UUIDs that Komorebi is using.Operating System
@LGUG2Z commented on GitHub (Oct 25, 2022):
99389f40f9If this ^ goes anywhere I think I should be able to add a command to target monitors by name as well as by index.
@LGUG2Z commented on GitHub (Oct 26, 2022):
On second thought that also wouldn't work as the monitor names are also not stable, but continuously incrementing on reconnection.
However, what should always be stable once the display positionings have been set is the
size, which is aRECTthat identifies the dimensions of the display on the big layout canvas in the settings.I think it should be possible to set an index preference for each display
RECT, so that on reconnection, instead of being pushed to the back of theRing<Monitor>, it can be inserted at the desired index if either that index is not out of bounds, or if expanding the vector to accommodate that index would not insert an empty element in order to bring that desired index into bounds.@LGUG2Z commented on GitHub (Oct 27, 2022):
This command has been added on the above referenced commit and from my limited testing with my iPad as an additional display it seems to keep monitor indices stable across connections and disconnections.