XQuartz: Better support turning off "Displays have separate Spaces" on OS X Mavericks

http://xquartz.macosforge.org/trac/ticket/1876

Follow-up to: 1c10b37380

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston Sequoia 2014-08-11 13:15:24 -07:00
parent dfbc6a1a78
commit ab32ee3589

View File

@ -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;
}