summaryrefslogtreecommitdiff
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 17:30:53 -0800
commit714b68d9e5bf624a6703f168e0f7dc980e88e8c0 (patch)
tree72666711e329091ccdbfd2595e15a3c4ab62a4c4
parent14f00449eb81771c01fffcdaf3dd697cdf4e41de (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>
-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);