mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-24 11:00:25 +01:00
XQuartz: RandR: Avoid over-releasing if we are unable to determine the current display mode.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
(cherry picked from commit 384eb45b94)
This commit is contained in:
parent
69e3527e25
commit
b4cb37d725
1 changed files with 11 additions and 8 deletions
|
|
@ -444,26 +444,29 @@ static Bool QuartzRandRSetConfig (ScreenPtr pScreen,
|
|||
|
||||
static Bool _QuartzRandRUpdateFakeModes (ScreenPtr pScreen) {
|
||||
QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen);
|
||||
QuartzModeInfo activeMode;
|
||||
|
||||
if (!QuartzRandRCopyCurrentModeInfo(pQuartzScreen->displayIDs[0], &activeMode)) {
|
||||
ErrorF("Unable to determine current display mode.\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(pQuartzScreen->fullscreenMode.ref)
|
||||
CFRelease(pQuartzScreen->fullscreenMode.ref);
|
||||
if(pQuartzScreen->currentMode.ref)
|
||||
CFRelease(pQuartzScreen->currentMode.ref);
|
||||
|
||||
if (!QuartzRandRCopyCurrentModeInfo(pQuartzScreen->displayIDs[0],
|
||||
&pQuartzScreen->fullscreenMode))
|
||||
return FALSE;
|
||||
|
||||
if (pQuartzScreen->displayCount > 1) {
|
||||
pQuartzScreen->fullscreenMode.width = pScreen->width;
|
||||
pQuartzScreen->fullscreenMode.height = pScreen->height;
|
||||
activeMode.width = pScreen->width;
|
||||
activeMode.height = pScreen->height;
|
||||
if(XQuartzIsRootless)
|
||||
pQuartzScreen->fullscreenMode.height += aquaMenuBarHeight;
|
||||
activeMode.height += aquaMenuBarHeight;
|
||||
}
|
||||
|
||||
pQuartzScreen->fullscreenMode = activeMode;
|
||||
pQuartzScreen->fullscreenMode.refresh = FAKE_REFRESH_FULLSCREEN;
|
||||
|
||||
pQuartzScreen->rootlessMode = pQuartzScreen->fullscreenMode;
|
||||
pQuartzScreen->rootlessMode = activeMode;
|
||||
pQuartzScreen->rootlessMode.refresh = FAKE_REFRESH_ROOTLESS;
|
||||
pQuartzScreen->rootlessMode.height -= aquaMenuBarHeight;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue