[Xquartz-changes] xserver: Branch 'master'
Jeremy Huddleston
jeremyhu at freedesktop.org
Thu Jul 29 14:51:38 PDT 2010
hw/xquartz/X11Application.m | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
New commits:
commit dc3b4946701ccb4e08c8d1cdfbfc0973ce3533f3
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Thu Jul 29 14:49:10 2010 -0700
XQuartz: Make application switching work better for the no-spaces case
We still have the issue with not raising the frontmost window for the case
when spaces is enabled, and the AppleSpacesSwitchOnActivate preference is
disabled.
Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 805ed99..4948b98 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -337,7 +337,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
case NSApplicationActivatedEventType:
for_x = NO;
if ([self modalWindow] == nil) {
- BOOL switch_on_activate, ok;
+ BOOL order_all_windows = YES, workspaces, ok;
for_appkit = NO;
/* FIXME: hack to avoid having to pass the event to appkit,
@@ -347,12 +347,19 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
[self activateX:YES];
/* Get the Spaces preference for SwitchOnActivate */
- (void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
- switch_on_activate = CFPreferencesGetAppBooleanValue(CFSTR("AppleSpacesSwitchOnActivate"), CFSTR(".GlobalPreferences"), &ok);
- if(!ok)
- switch_on_activate = YES;
+ (void)CFPreferencesAppSynchronize(CFSTR("com.apple.dock"));
+ workspaces = CFPreferencesGetAppBooleanValue(CFSTR("workspaces"), CFSTR("workspaces"), &ok);
+ if (!ok)
+ workspaces = NO;
+
+ if (workspaces) {
+ (void)CFPreferencesAppSynchronize(CFSTR(".GlobalPreferences"));
+ order_all_windows = CFPreferencesGetAppBooleanValue(CFSTR("AppleSpacesSwitchOnActivate"), CFSTR(".GlobalPreferences"), &ok);
+ if (!ok)
+ order_all_windows = YES;
+ }
- if ([e data2] & 0x10 && switch_on_activate) // 0x10 is set when we use cmd-tab or the dock icon
+ if ([e data2] & 0x10 && order_all_windows) // 0x10 is set when we use cmd-tab or the dock icon
DarwinSendDDXEvent(kXquartzBringAllToFront, 0);
}
break;
More information about the Xquartz-changes
mailing list