summaryrefslogtreecommitdiff
path: root/hw/xquartz
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2010-12-03 17:27:44 -0800
committerJeremy Huddleston <jeremyhu@apple.com>2010-12-03 21:56:26 -0800
commit47d474ee8fb29758ec61c128d000f760dd040be4 (patch)
tree4aaf2e801d14a829f13fc0741b0fa89492c309d1 /hw/xquartz
parent4c3aaef3ffa4a22c951331ef36c45b95f719a907 (diff)
XQuartz: RandR: Fix mode changing for multi-monitor configurations.
This just fixes the regression whereby we couldn't switch between the legacy fullscreen mode and rootless on multi-monitor configurations. This was happening because ref wasn't being set in these cases (since we don't ever actually change CG modes), so we failed a CFEqual. Setting the references fixes this regression and places us one step closer to more mode RandR mode switching in multi-monitor configurations. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> (cherry picked from commit 714b68d9e5bf624a6703f168e0f7dc980e88e8c0)
Diffstat (limited to 'hw/xquartz')
-rw-r--r--hw/xquartz/quartzRandR.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/hw/xquartz/quartzRandR.c b/hw/xquartz/quartzRandR.c
index 298ec0a52..296f9b669 100644
--- a/hw/xquartz/quartzRandR.c
+++ b/hw/xquartz/quartzRandR.c
@@ -438,18 +438,16 @@ static Bool QuartzRandRSetConfig (ScreenPtr pScreen,
static Bool _QuartzRandRUpdateFakeModes (ScreenPtr pScreen) {
QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen);
- if (pQuartzScreen->displayCount == 1) {
- if(pQuartzScreen->fullscreenMode.ref)
- CFRelease(pQuartzScreen->fullscreenMode.ref);
- if(pQuartzScreen->currentMode.ref)
- CFRelease(pQuartzScreen->currentMode.ref);
+ 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 (!QuartzRandRCopyCurrentModeInfo(pQuartzScreen->displayIDs[0],
+ &pQuartzScreen->fullscreenMode))
+ return FALSE;
- CFRetain(pQuartzScreen->fullscreenMode.ref); /* This extra retain is for currentMode's copy */
- } else {
+ if (pQuartzScreen->displayCount > 1) {
pQuartzScreen->fullscreenMode.width = pScreen->width;
pQuartzScreen->fullscreenMode.height = pScreen->height;
if(XQuartzIsRootless)
@@ -467,6 +465,11 @@ static Bool _QuartzRandRUpdateFakeModes (ScreenPtr pScreen) {
} else {
pQuartzScreen->currentMode = pQuartzScreen->fullscreenMode;
}
+
+ /* This extra retain is for currentMode's copy.
+ * fullscreen and rootless share a retain.
+ */
+ CFRetain(pQuartzScreen->currentMode.ref);
DEBUG_LOG("rootlessMode: %d x %d\n", (int)pQuartzScreen->rootlessMode.width, (int)pQuartzScreen->rootlessMode.height);
DEBUG_LOG("fullscreenMode: %d x %d\n", (int)pQuartzScreen->fullscreenMode.width, (int)pQuartzScreen->fullscreenMode.height);