Skip to content

Fix display mode restoration for rotated monitors - #34

Open
Samuel-Georgiev wants to merge 1 commit into
zac15987:mainfrom
Samuel-Georgiev:fix-display-mode-restore
Open

Samuel-Georgiev wants to merge 1 commit into
zac15987:mainfrom
Samuel-Georgiev:fix-display-mode-restore

Conversation

@Samuel-Georgiev

Copy link
Copy Markdown

Summary

Fixes resolution and refresh rate not always being restored correctly after a display topology change.

Saved display modes are now reapplied after the topology is restored. Displays are matched using their adapter/target IDs, and 90°/270° rotations are accounted for when applying the resolution.

The rotation handling fixes a case where Windows expects the dimensions to be swapped after a display is rotated. For example, restoring 1920x1080@165 on a 270° display returned DISP_CHANGE_BADMODE (-2), while 1080x1920@165 applied successfully.

This overlaps with #31, which restores the refresh rate for newly enabled displays during staged profile application. This approach restores the saved mode for all enabled displays after the topology change, while also handling rotated displays and avoiding reliance on DISPLAY1/DISPLAY2 numbering.

Tested across repeated profile switches with multiple resolutions, refresh rates, and display orientations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant