summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2014-08-11 13:15:24 -0700
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2014-08-11 13:20:01 -0700
commit9ec06980d794038fe68cdb3b22dac298b8f43cb7 (patch)
tree3d9cdacd4449c1ccd97ba845381e6c1f531f9ff8
parent0fc3572b88e5e22e399059978080696a03f680f1 (diff)
XQuartz: Better support turning off "Displays have separate Spaces" on OS X Mavericksserver-1.15-branch
http://xquartz.macosforge.org/trac/ticket/1876 Follow-up to: 1c10b37380d228b35db8a8616a6312ac54f5e59b Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> (cherry picked from commit ab32ee35890be51137b56525826ffe219b63eb88)
-rw-r--r--hw/xquartz/xpr/xprScreen.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 7aa1ae1df..d0a525ff4 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -169,14 +169,25 @@ displayScreenBounds(CGDirectDisplayID id)
(int)frame.size.width, (int)frame.size.height,
(int)frame.origin.x, (int)frame.origin.y);
- /* Remove menubar to help standard X11 window managers.
- * On Mavericks and later, the menu bar is on all displays.
- */
- if (XQuartzIsRootless
+ Boolean spacePerDisplay = false;
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
- && (NSAppKitVersionNumber >= 1265 || (frame.origin.x == 0 && frame.origin.y == 0))
+ if (NSAppKitVersionNumber >= 1265)
#endif
- ) {
+ {
+ Boolean ok;
+ (void)CFPreferencesAppSynchronize(CFSTR("com.apple.spaces"));
+ spacePerDisplay = ! CFPreferencesGetAppBooleanValue(CFSTR("spans-displays"),
+ CFSTR("com.apple.spaces"),
+ &ok);
+ if (!ok)
+ spacePerDisplay = true;
+ }
+
+ /* Remove menubar to help standard X11 window managers.
+ * On Mavericks and later, the menu bar is on all displays when spans-displays is false or unset.
+ */
+ if (XQuartzIsRootless &&
+ (spacePerDisplay || (frame.origin.x == 0 && frame.origin.y == 0))) {
frame.origin.y += aquaMenuBarHeight;
frame.size.height -= aquaMenuBarHeight;
}