summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-05-14 18:33:57 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-05-16 18:47:27 -0700
commitb4cb37d7255746f2ddf0ceb3334fc698cd818410 (patch)
treeacdb23d74adc71d7c3ae6f8a3eddc526e990783f
parent69e3527e257af2aae82449bf0e0e7846ccd1ce0c (diff)
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 384eb45b944a4386eae74a5503423c13b5f2a659)
-rw-r--r--hw/xquartz/quartzRandR.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/hw/xquartz/quartzRandR.c b/hw/xquartz/quartzRandR.c
index 05641a65d..d452b029a 100644
--- a/hw/xquartz/quartzRandR.c
+++ b/hw/xquartz/quartzRandR.c
@@ -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;