XQuartz: Honor the Spaces preference for "When switching to an application, switch to a space with open windows for the application"

This commit is contained in:
Jeremy Huddleston 2008-10-23 11:37:13 -07:00
parent ec9f00b980
commit bf561a06b2

View File

@ -293,7 +293,15 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
_appFlags._active = YES;
[self activateX:YES];
if ([e data2] & 0x10)
/* Get the Spaces preference for SwitchOnActivate */
(void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
BOOL switch_on_activate, ok;
switch_on_activate = CFPreferencesGetAppBooleanValue(CFSTR("AppleSpacesSwitchOnActivate"), CFSTR(".GlobalPreferences"), &ok);
if(!ok)
switch_on_activate = YES;
if ([e data2] & 0x10 && switch_on_activate)
DarwinSendDDXEvent(kXquartzBringAllToFront, 0);
}
break;