glzr-io/glazewm

monitor number swapped

Closed this issue · 4 comments

i have 2 monitors and the numbers keep switching

2 workspaces

1 on main monitor

2 on the second

my workspaces:

workspaces:

  • name: "1"
    display_name: " "
    keep_alive: true
    bind_to_monitor: 2
  • name: "2"
    display_name: " "
    bind_to_monitor: 1

the only thing i find to fix is to reboot

Yep, this is an infamous issue. This is because, under the hood somehow, Windows re-initializes your displays when waking from sleep or cycling power to the monitors. So, to quote LGUG2Z, 1 and 2 become 4 and 3. So yes, Windows has a way of identifying monitors which does not correlate to anything displayed by your system settings, no, you cannot just directly access what the system settings say, and yes, they are actively working on it for the V3 rewrite.

Man, why is Windows such a pain to develop for? It's awful.

As a workaround what worked for me at least once (needs more testing :) ) is to close glazeWM and delete all the window desktops (keep only one). Then when I restarted glazeWM it created the workspaces on the right monitors and with the right application to worspace/monitor.

Not ideal but still better than rebooting and might be automatised.

I have the same issue in both my remote workspace and my personal pc. I never close environment in my workplace. So that's a hassle. I think it would be the easiest fix if we can use the display id (e.g. //LGHDDISPLAY1) instead of the display number we get from windows.

Crashes and inconsistencies on display setting changes, system standby, and monitor disconnections should now be fixed in v3 🎉 Latest release