diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-10-23 11:37:13 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-10-23 14:17:19 -0700 |
commit | 3e999d35c26b0ffb894c257a3057d44b949744bd (patch) | |
tree | fb14d6771fcae414f9715188f1470b9457c696bc | |
parent | 75067d12e4f4daa080dfb0209a9abf9c5654271f (diff) |
XQuartz: Honor the Spaces preference for "When switching to an application, switch to a space with open windows for the application"
(cherry picked from commit bf561a06b2bf60395d26026ac7627d0cb254bc07)
-rw-r--r-- | hw/xquartz/X11Application.m | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index c1a519436..00c2c3c74 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -294,7 +294,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; |