Ken Thomases : winemac: Transform the process to a GUI app on an attempt to change the display mode.

Alexandre Julliard julliard at winehq.org
Mon May 14 17:20:10 CDT 2018


Module: wine
Branch: master
Commit: 09bf88092d0748ceac355098a942b01b267e8773
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=09bf88092d0748ceac355098a942b01b267e8773

Author: Ken Thomases <ken at codeweavers.com>
Date:   Mon May 14 13:32:29 2018 -0500

winemac: Transform the process to a GUI app on an attempt to change the display mode.

It had only been done when a window is shown.  Some games change the display
mode before showing their first window.  Following Mac conventions, the Mac
driver does not apply display mode changes when it's not the active GUI app.
If such a game were to change the mode and then query display-mode-related info,
it would get info for the original mode, not the requested mode.

Signed-off-by: Ken Thomases <ken at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winemac.drv/cocoa_app.m | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m
index 46176f7..239c11f 100644
--- a/dlls/winemac.drv/cocoa_app.m
+++ b/dlls/winemac.drv/cocoa_app.m
@@ -843,7 +843,6 @@ static NSString* WineLocalizedString(unsigned int stringID)
         }
         else
         {
-            BOOL active = [NSApp isActive];
             CGDisplayModeRef currentMode;
             NSArray* modes;
 
@@ -866,6 +865,10 @@ static NSString* WineLocalizedString(unsigned int stringID)
             if (!modes.count)
                 return FALSE;
 
+            [self transformProcessToForeground];
+
+            BOOL active = [NSApp isActive];
+
             if ([originalDisplayModes count] || displaysCapturedForFullscreen ||
                 !active || CGCaptureAllDisplays() == CGDisplayNoErr)
             {




More information about the wine-cvs mailing list