Commit fe1c0ab9 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Don't record original display modes when not the active app.

originalDisplayModes should be used when active, empty when inactive. latentDisplayModes is used when inactive, empty when active. The count of entries in originalDisplayModes is used to test whether the process has the displays captured so adding entries when inactive would give incorrect results. This could have led us to mistakenly change the display mode when we don't have the displays captured.
parent a1d8886f
......@@ -770,21 +770,23 @@ int macdrv_err_on;
!active || CGCaptureAllDisplays() == CGDisplayNoErr)
{
if (active)
{
ret = (CGDisplaySetDisplayMode(displayID, mode, NULL) == CGDisplayNoErr);
if (ret)
[originalDisplayModes setObject:(id)originalMode forKey:displayIDKey];
else if (![originalDisplayModes count])
{
CGRestorePermanentDisplayConfiguration();
[latentDisplayModes removeAllObjects];
if (!displaysCapturedForFullscreen)
CGReleaseAllDisplays();
}
}
else
{
[latentDisplayModes setObject:(id)mode forKey:displayIDKey];
ret = TRUE;
}
if (ret)
[originalDisplayModes setObject:(id)originalMode forKey:displayIDKey];
else if (![originalDisplayModes count])
{
CGRestorePermanentDisplayConfiguration();
[latentDisplayModes removeAllObjects];
if (!displaysCapturedForFullscreen)
CGReleaseAllDisplays();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment