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@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ken Thomases 2018-05-14 13:32:29 -05:00 committed by Alexandre Julliard
parent 9ffc6e600e
commit 09bf88092d
1 changed files with 4 additions and 1 deletions

View File

@ -843,7 +843,6 @@ - (BOOL) setMode:(CGDisplayModeRef)mode forDisplay:(CGDirectDisplayID)displayID
}
else
{
BOOL active = [NSApp isActive];
CGDisplayModeRef currentMode;
NSArray* modes;
@ -866,6 +865,10 @@ - (BOOL) setMode:(CGDisplayModeRef)mode forDisplay:(CGDirectDisplayID)displayID
if (!modes.count)
return FALSE;
[self transformProcessToForeground];
BOOL active = [NSApp isActive];
if ([originalDisplayModes count] || displaysCapturedForFullscreen ||
!active || CGCaptureAllDisplays() == CGDisplayNoErr)
{