monitor id changes when physical monitor switches off - therfeore komorebi is broken #27

Closed
opened 2026-01-05 14:47:46 +01:00 by adam · 5 comments
Owner

Originally created by @pigmej on GitHub (Sep 8, 2021).

Originally assigned to: @LGUG2Z on GitHub.

Not sure how to report but here it is.

I'm using laptop with dock station, I have configured that my monitors are switching off after 10 mins. I have 2 standalone physical monitors + laptop screen.

I observed that whenever the monitor switches on again (and therefore passes the windows login screen again) then the monitor id changes.

My flow is following:

  1. use komorebi
  2. leave computer
  3. screens are shutting down (but computer is not going to sleep/hibernate)
  4. I unlock PC again
  5. komorebi broken

That completely breaks komorebi state and forces me to restart it that at the end makes all windows appear in random places.

I was thinking that maybe instead of that id komorebi could use native windows numbering OR some name matching. Because all "windows" related settings of the screens are somehow persisted in Windows so there should be some API to identify them in other way than this changing ID.

I think that problem exists for most of the "mobile" users, not sure about desktop with similar power plans, it could be related to thunderbolt dell dock station (WD19S).

When I DON'T use komorebi I had to use Persistent Windows on windows10 to make my windows stay at correct screens, and in windows 11 it somehow self resolved (komorebi issue visible at both 10 and 11)

Originally created by @pigmej on GitHub (Sep 8, 2021). Originally assigned to: @LGUG2Z on GitHub. Not sure how to report but here it is. I'm using laptop with dock station, I have configured that my monitors are switching off after 10 mins. I have 2 standalone physical monitors + laptop screen. I observed that whenever the monitor switches on again (and therefore passes the windows login screen again) then the monitor id changes. My flow is following: 1) use komorebi 2) leave computer 3) screens are shutting down (but computer is not going to sleep/hibernate) 4) I unlock PC again 5) komorebi broken That completely breaks komorebi state and forces me to restart it that at the end makes all windows appear in random places. I was thinking that maybe instead of that id komorebi could use native windows numbering OR some name matching. Because all "windows" related settings of the screens are somehow persisted in Windows so there should be some API to identify them in other way than this changing ID. I think that problem exists for most of the "mobile" users, not sure about desktop with similar power plans, it could be related to thunderbolt dell dock station (WD19S). When I DON'T use komorebi I had to use Persistent Windows on windows10 to make my windows stay at correct screens, and in windows 11 it somehow self resolved (komorebi issue visible at both 10 and 11)
adam added the enhancement label 2026-01-05 14:47:46 +01:00
adam closed this issue 2026-01-05 14:47:46 +01:00
Author
Owner

@pigmej commented on GitHub (Sep 8, 2021):

The other option that I thought of is to figure way to "replace" old ids with new ids, as that could be easily done with some hook everytime when monitor on/off happens behind the scenes for komorebi. I checked few times and the order of ids was always the same, I mean it was NOT changing. So monitor 1 had always lower value than monitor 2.

I was trying to understand the code and figure out how that could be done but that's currently beyond my time limit sadly ;/

@pigmej commented on GitHub (Sep 8, 2021): The other option that I thought of is to figure way to "replace" old ids with new ids, as that could be easily done with some hook everytime when monitor on/off happens behind the scenes for komorebi. I checked few times and the order of ids was always the same, I mean it was NOT changing. So monitor 1 had always lower value than monitor 2. I was trying to understand the code and figure out how that could be done but that's currently beyond my time limit sadly ;/
Author
Owner

@LGUG2Z commented on GitHub (Sep 10, 2021):

@pigmej I've made a start on tracking the hot plugging/unplugging of monitors on the feature/monitor-tracking branch. Monitors should now be added and removed from the window manager state appropriately without breaking the window manager functionality.

I think any sort of persistent window functionality is ultimately out of scope for this project, but I believe that with these new monitor tracking changes, komorebi should be able to work in tandem with other software such as Persistent Windows.

@LGUG2Z commented on GitHub (Sep 10, 2021): @pigmej I've made a start on tracking the hot plugging/unplugging of monitors on the `feature/monitor-tracking` branch. Monitors should now be added and removed from the window manager state appropriately without breaking the window manager functionality. I think any sort of persistent window functionality is ultimately out of scope for this project, but I believe that with these new monitor tracking changes, `komorebi` should be able to work in tandem with other software such as Persistent Windows.
Author
Owner

@pigmej commented on GitHub (Sep 10, 2021):

Hey,

Cool. Today i stumbled upon https://superuser.com/questions/453446/how-can-i-stop-windows-re-positioning-after-waking-from-sleep which I will test when I will find time. Maybe then this will become somehow simpler for Komorebi and others facing similar issue. Maybe the fix is doable with going the Intel GPU settings instead of windows default one.

I will also check your branch obviously :).

@pigmej commented on GitHub (Sep 10, 2021): Hey, Cool. Today i stumbled upon https://superuser.com/questions/453446/how-can-i-stop-windows-re-positioning-after-waking-from-sleep which I will test when I will find time. Maybe then this will become somehow simpler for Komorebi and others facing similar issue. Maybe the fix is doable with going the Intel GPU settings instead of windows default one. I will also check your branch obviously :).
Author
Owner

@LGUG2Z commented on GitHub (Sep 13, 2021):

I've spent the last few days putting the hot plugging detection through its paces and I'm happy to have it merged to the master branch now. If you find a solution that you like for window permanence, please feel free to open a PR to the README for others that may have the same requirements.

@LGUG2Z commented on GitHub (Sep 13, 2021): I've spent the last few days putting the hot plugging detection through its paces and I'm happy to have it merged to the `master` branch now. If you find a solution that you like for window permanence, please feel free to open a PR to the README for others that may have the same requirements.
Author
Owner

@pigmej commented on GitHub (Sep 14, 2021):

I've been running the branch version from yesterday morning. So far so good. Seems that currently, it works good with PersistentWindows. Sadly none of the stuff from the link above helped permanently.

@pigmej commented on GitHub (Sep 14, 2021): I've been running the branch version from yesterday morning. So far so good. Seems that currently, it works good with PersistentWindows. Sadly none of the stuff from the link above helped permanently.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#27