Skip to content

Commit

Permalink
winemac: Transform the process to a GUI app on an attempt to change t…
Browse files Browse the repository at this point in the history
…he 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 <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>
  • Loading branch information
KenThomases authored and julliard committed May 14, 2018
1 parent 9ffc6e6 commit 09bf880
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dlls/winemac.drv/cocoa_app.m
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,6 @@ - (BOOL) setMode:(CGDisplayModeRef)mode forDisplay:(CGDirectDisplayID)displayID
}
else
{
BOOL active = [NSApp isActive];
CGDisplayModeRef currentMode;
NSArray* modes;

Expand All @@ -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)
{
Expand Down

0 comments on commit 09bf880

Please sign in to comment.