[wsi] Check more display mode flags when comparing them. #4764
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
EnumDisplaySettings(..., ENUM_CURRENT_SETTINGS, ...) is guaranteed to have DM_DISPLAYORIENTATION, DM_BITSPERPEL, DM_PELSWIDTH, DM_PELSHEIGHT, DM_DISPLAYFLAGS, DM_DISPLAYFREQUENCY, and DM_POSITION.
If we don't compare positions, then in Win32WsiDriver::restoreDisplayMode(), the original monitor layout might not be restored. For example, a secondary 1080p monitor at (3840, 0) can be moved to (1280, -1080) after the primary 4K monitor resolution changes to 720p and back to 4K. And due to the secondary monitor having the same resolution, its position won't be restored before this patch.
Fix Rime (493200) fails to switch monitors in borderless mode in some cases for Proton 10 alpha.
Related to #2064.