Module: wine Branch: master Commit: 28dfeefccafda17ade9776722367f816fd3539a1 URL: https://gitlab.winehq.org/wine/wine/-/commit/28dfeefccafda17ade9776722367f81...
Author: Tim Clem tclem@codeweavers.com Date: Tue May 7 14:33:17 2024 -0700
winemac.drv: Prefer display modes that are marked as usable for desktop.
Some devices, like the Apple Studio Display, have modes that differ only in this flag, and switching to the ones that are not usable for desktop results in an error.
---
dlls/winemac.drv/display.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index b1a5a4500d2..ed27390ac30 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -475,6 +475,7 @@ static BOOL mode_is_preferred(CGDisplayModeRef new_mode, CGDisplayModeRef old_mo BOOL new_is_supported; CFStringRef pixel_encoding; size_t width_points, height_points; + BOOL new_usable_for_desktop, old_usable_for_desktop; size_t old_width_pixels, old_height_pixels, new_width_pixels, new_height_pixels; BOOL old_size_same, new_size_same;
@@ -516,6 +517,12 @@ static BOOL mode_is_preferred(CGDisplayModeRef new_mode, CGDisplayModeRef old_mo if (!new_is_supported && display_mode_is_supported(old_mode)) return FALSE;
+ /* Prefer modes that are usable for desktop over ones that aren't. */ + new_usable_for_desktop = CGDisplayModeIsUsableForDesktopGUI(new_mode); + old_usable_for_desktop = CGDisplayModeIsUsableForDesktopGUI(old_mode); + if (new_usable_for_desktop && !old_usable_for_desktop) + return TRUE; + /* Otherwise, prefer a mode whose pixel size equals its point size over one which is scaled. */ width_points = CGDisplayModeGetWidth(new_mode);