Open janlothar opened 1 year ago
Trying to switch to a display that is disabled results in throwing a unhandled exception. Here I try to switch to DISPLAY2
PS C:\Program Files\sunshine_utils> .\resolution_change.exe -d \\.\DISPLAY2 --width 3840 --height 2160 --refreshrate 120 --detach-other-monitors Traceback (most recent call last): File "resolution_change.py", line 196, in <module> File "resolution_change.py", line 95, in change_display KeyError: '\\\\.\\DISPLAY2' [11188] Failed to execute script 'resolution_change' due to unhandled exception!
after enabling the monitor through display settings and running the the same command, it works:
PS C:\Program Files\sunshine_utils> .\resolution_change.exe -d \\.\DISPLAY2 --width 3840 --height 2160 --refreshrate 120 --detach-other-monitors Switching resolution to 3840x2160 at 120Hz
and using -r afterwards also works fine
-r
PS C:\Program Files\sunshine_utils> .\resolution_change.exe -r Resetting resolution Reset to: Display name: \\.\DISPLAY1 - Enabled: True, Primary: True - 3440x1440 Display name: \\.\DISPLAY2 - Enabled: True, Primary: False - 3840x2160
Were I to switch to DISPLAY2 using --detach-other-monitors and then try to switch back to DISPLAY1 then I would get the same error:
--detach-other-monitors
PS C:\Program Files\sunshine_utils> .\resolution_change.exe -d \\.\DISPLAY2 --width 3840 --height 2160 --refreshrate 120 --detach-other-monitors Switching resolution to 3840x2160 at 120Hz PS C:\Program Files\sunshine_utils> .\resolution_change.exe -d \\.\DISPLAY1 --width 3440 --height 1440 --refreshrate 144 --detach-other-monitors Traceback (most recent call last): File "resolution_change.py", line 196, in <module> File "resolution_change.py", line 95, in change_display KeyError: '\\\\.\\DISPLAY1' [8572] Failed to execute script 'resolution_change' due to unhandled exception! PS C:\Program Files\sunshine_utils> .\resolution_change.exe -r Resetting resolution Reset to: Display name: \\.\DISPLAY1 - Enabled: True, Primary: True - 3440x1440 Display name: \\.\DISPLAY2 - Enabled: True, Primary: False - 3840x2160
Trying to switch to a display that is disabled results in throwing a unhandled exception. Here I try to switch to DISPLAY2
after enabling the monitor through display settings and running the the same command, it works:
and using
-r
afterwards also works fineWere I to switch to DISPLAY2 using
--detach-other-monitors
and then try to switch back to DISPLAY1 then I would get the same error: