diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h index 86da67f2e..ea9a6b758 100644 --- a/hw/xquartz/X11Application.h +++ b/hw/xquartz/X11Application.h @@ -98,6 +98,8 @@ extern int quartzHasRoot, quartzEnableRootless; #define PREFS_XP_OPTIONS "xp_options" #define PREFS_ENABLE_STEREO "enable_stereo" #define PREFS_LOGIN_SHELL "login_shell" -#define PREFS_QUARTZ_WM_CLICK_THROUGH "wm_click_through" +#define PREFS_CLICK_THROUGH "wm_click_through" +#define PREFS_FFM "wm_ffm" +#define PREFS_FOCUS_ON_NEW_WINDOW "wm_focus_on_new_window" #endif /* X11APPLICATION_H */ diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h index 64d5cd1ce..8d6a38ff0 100644 --- a/hw/xquartz/X11Controller.h +++ b/hw/xquartz/X11Controller.h @@ -45,6 +45,8 @@ IBOutlet NSButton *enable_keyequivs; IBOutlet NSButton *sync_keymap; IBOutlet NSButton *click_through; + IBOutlet NSButton *focus_follows_mouse; + IBOutlet NSButton *focus_on_new_window; IBOutlet NSButton *enable_auth; IBOutlet NSButton *enable_tcp; IBOutlet NSPopUpButton *depth; diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index 5111eafc3..3880b3f38 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -609,24 +609,28 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row - (IBAction)prefs_changed:sender { - darwinFakeButtons = [fake_buttons intValue]; - quartzUseSysBeep = [use_sysbeep intValue]; - X11EnableKeyEquivalents = [enable_keyequivs intValue]; - darwinSyncKeymap = [sync_keymap intValue]; - - /* after adding prefs here, also add to [X11Application read_defaults] + darwinFakeButtons = [fake_buttons intValue]; + quartzUseSysBeep = [use_sysbeep intValue]; + X11EnableKeyEquivalents = [enable_keyequivs intValue]; + darwinSyncKeymap = [sync_keymap intValue]; + + /* after adding prefs here, also add to [X11Application read_defaults] and below */ - [NSApp prefs_set_boolean:@PREFS_FAKEBUTTONS value:darwinFakeButtons]; - [NSApp prefs_set_boolean:@PREFS_SYSBEEP value:quartzUseSysBeep]; - [NSApp prefs_set_boolean:@PREFS_KEYEQUIVS value:X11EnableKeyEquivalents]; - [NSApp prefs_set_boolean:@PREFS_SYNC_KEYMAP value:darwinSyncKeymap]; - [NSApp prefs_set_boolean:@PREFS_QUARTZ_WM_CLICK_THROUGH value:[click_through intValue]]; - [NSApp prefs_set_boolean:@PREFS_NO_AUTH value:![enable_auth intValue]]; - [NSApp prefs_set_boolean:@PREFS_NO_TCP value:![enable_tcp intValue]]; - [NSApp prefs_set_integer:@PREFS_DEPTH value:[depth selectedTag]]; + [NSApp prefs_set_boolean:@PREFS_FAKEBUTTONS value:darwinFakeButtons]; + [NSApp prefs_set_boolean:@PREFS_SYSBEEP value:quartzUseSysBeep]; + [NSApp prefs_set_boolean:@PREFS_KEYEQUIVS value:X11EnableKeyEquivalents]; + [NSApp prefs_set_boolean:@PREFS_SYNC_KEYMAP value:darwinSyncKeymap]; + [NSApp prefs_set_boolean:@PREFS_CLICK_THROUGH value:[click_through intValue]]; + [NSApp prefs_set_boolean:@PREFS_FFM value:[focus_follows_mouse intValue]]; + [NSApp prefs_set_boolean:@PREFS_FOCUS_ON_NEW_WINDOW value:[focus_on_new_window intValue]]; + [NSApp prefs_set_boolean:@PREFS_NO_AUTH value:![enable_auth intValue]]; + [NSApp prefs_set_boolean:@PREFS_NO_TCP value:![enable_tcp intValue]]; + [NSApp prefs_set_integer:@PREFS_DEPTH value:[depth selectedTag]]; + + system("killall -HUP quartz-wm"); - [NSApp prefs_synchronize]; + [NSApp prefs_synchronize]; } - (IBAction) prefs_show:sender @@ -636,8 +640,10 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row [enable_keyequivs setIntValue:X11EnableKeyEquivalents]; [sync_keymap setIntValue:darwinSyncKeymap]; [sync_keymap setEnabled:darwinKeymapFile == NULL]; - [click_through setIntValue:[NSApp prefs_get_boolean:@PREFS_QUARTZ_WM_CLICK_THROUGH default:NO]]; - + [click_through setIntValue:[NSApp prefs_get_boolean:@PREFS_CLICK_THROUGH default:NO]]; + [focus_follows_mouse setIntValue:[NSApp prefs_get_boolean:@PREFS_FFM default:NO]]; + [focus_on_new_window setIntValue:[NSApp prefs_get_boolean:@PREFS_FOCUS_ON_NEW_WINDOW default:YES]]; + [enable_auth setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_AUTH default:NO]]; [enable_tcp setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_TCP default:NO]]; [depth selectItemAtIndex:[depth indexOfItemWithTag:[NSApp prefs_get_integer:@PREFS_DEPTH default:-1]]]; diff --git a/hw/xquartz/bundle/English.lproj/main.nib/designable.nib b/hw/xquartz/bundle/English.lproj/main.nib/designable.nib index ea3a0daa8..adc0340ed 100644 --- a/hw/xquartz/bundle/English.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/English.lproj/main.nib/designable.nib @@ -8,8 +8,6 @@ 352.00 YES - - YES @@ -448,7 +446,7 @@ 3 2 - {{319, 294}, {481, 345}} + {{266, 392}, {484, 280}} 1350041600 X11 Preferences NSPanel @@ -465,7 +463,7 @@ 256 - {{10, 10}, {458, 325}} + {{13, 10}, {458, 264}} YES @@ -474,14 +472,14 @@ 1 - + 256 YES 256 - {{18, 243}, {402, 18}} + {{18, 182}, {402, 18}} YES @@ -508,7 +506,7 @@ 256 - {{36, 93}, {385, 31}} + {{36, 32}, {385, 31}} YES @@ -544,7 +542,7 @@ 256 - {{36, 208}, {385, 29}} + {{36, 147}, {385, 29}} YES @@ -561,7 +559,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{18, 130}, {402, 18}} + {{18, 69}, {402, 18}} YES @@ -582,7 +580,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{36, 159}, {385, 14}} + {{36, 98}, {385, 14}} YES @@ -598,7 +596,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{18, 179}, {402, 18}} + {{18, 118}, {402, 18}} YES @@ -616,46 +614,8 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 25 - - - 256 - {{18, 69}, {402, 18}} - - YES - - 67239424 - 0 - Click-through Inactive Windows - - - 1211912703 - 2 - - - - 200 - 25 - - - - - 256 - {{33, 32}, {385, 31}} - - YES - - 67239424 - 4194304 - When enabled, clicking on an inactive window will cause that mouse click to pass through to that window in addition to activating it. - - - - - - - {{10, 33}, {438, 279}} - + {{10, 33}, {438, 218}} Input @@ -673,7 +633,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{18, 116}, {402, 18}} + {{18, 55}, {402, 18}} YES @@ -694,7 +654,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{36, 82}, {385, 28}} + {{36, 21}, {385, 28}} YES @@ -710,7 +670,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{74, 235}, {128, 26}} + {{74, 174}, {128, 26}} YES @@ -801,7 +761,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{17, 238}, {55, 20}} + {{17, 177}, {55, 20}} YES @@ -817,7 +777,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{36, 216}, {392, 14}} + {{36, 155}, {392, 14}} YES @@ -833,7 +793,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{18, 182}, {409, 23}} + {{18, 121}, {409, 23}} YES @@ -854,7 +814,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{36, 145}, {385, 31}} + {{36, 84}, {385, 31}} YES @@ -868,12 +828,140 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA - {{10, 33}, {438, 279}} + {{10, 33}, {438, 218}} Output + + + 2 + + + + 256 + + YES + + + 256 + {{15, 184}, {402, 18}} + + YES + + 67239424 + 0 + Click-through Inactive Windows + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{23, 147}, {385, 31}} + + YES + + 67239424 + 4194304 + When enabled, clicking on an inactive window will cause that mouse click to pass through to that window in addition to activating it. + + + + + + + + + 256 + {{15, 123}, {402, 18}} + + YES + + 67239424 + 0 + Focus Follows Mouse + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{23, 100}, {385, 17}} + + YES + + 67239424 + 4194304 + X11 window focus follows the cursor + + + + + + + + + 256 + {{15, 79}, {402, 18}} + + YES + + 67239424 + 0 + Focus On New Windows + + + 1211912703 + 2 + + + + 200 + 25 + + + + + 256 + {{23, 45}, {385, 28}} + + YES + + 67239424 + 4194304 + When enabled, creation of a new X11 window will cause X11.app to move to the foreground (instead of Finder.app, Terminal.app, etc. + + + + + + + + {{10, 33}, {438, 218}} + + + Windows + + + @@ -883,7 +971,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{18, 243}, {402, 18}} + {{18, 182}, {402, 18}} YES @@ -904,7 +992,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{18, 166}, {402, 18}} + {{18, 105}, {402, 18}} YES @@ -925,7 +1013,7 @@ ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA 256 - {{36, 195}, {385, 42}} + {{36, 134}, {385, 42}} YES @@ -943,7 +1031,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 256 - {{36, 118}, {385, 42}} + {{36, 57}, {385, 42}} YES @@ -959,7 +1047,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 256 - {{20, 17}, {404, 14}} + {{20, -44}, {404, 14}} YES @@ -973,27 +1061,27 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 - {{10, 33}, {438, 279}} + {{10, 33}, {438, 218}} Security - + 0 YES YES YES - + - {481, 345} + {484, 280} - {{0, 0}, {1440, 878}} + {{0, 0}, {1280, 938}} {213, 129} {3.40282e+38, 3.40282e+38} x11_prefs @@ -1001,7 +1089,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 11 2 - {{361, 362}, {454, 311}} + {{302, 400}, {454, 311}} 1350041600 X11 Application Menu NSPanel @@ -1011,7 +1099,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 {10000, 10000} {320, 240} - + 256 YES @@ -1353,9 +1441,8 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 {454, 311} - - {{0, 0}, {1440, 878}} + {{0, 0}, {1280, 938}} {320, 262} x11_apps @@ -1841,14 +1928,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 549 - - - prefs_changed: - - - - 300300 - window_separator @@ -1857,14 +1936,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 300331 - - - click_through - - - - 300332 - menu @@ -1881,6 +1952,54 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 300336 + + + prefs_changed: + + + + 300389 + + + + prefs_changed: + + + + 300390 + + + + prefs_changed: + + + + 300391 + + + + click_through + + + + 300392 + + + + focus_follows_mouse + + + + 300393 + + + + focus_on_new_window + + + + 300394 + @@ -2239,6 +2358,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 + @@ -2262,8 +2382,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 - - @@ -2670,34 +2788,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 - - 300296 - - - YES - - - - - - 300297 - - - - - 300298 - - - YES - - - - - - 300299 - - - 295 @@ -2853,6 +2943,113 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 + + 300337 + + + YES + + + + + + 300338 + + + YES + + + + + + + + + + + 300358 + + + YES + + + + + + 300359 + + + YES + + + + + + 300360 + + + + + 300361 + + + + + 300362 + + + YES + + + + + + 300363 + + + + + 300364 + + + YES + + + + + + 300365 + + + + + 300368 + + + YES + + + + + + 300369 + + + + + 300370 + + + YES + + + + + + 300371 + + + @@ -2919,10 +3116,12 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 24.IBPluginDependency 24.ImportedFromIB2 24.editorWindowContentRectSynchronizationRect + 244.IBEditorWindowLastContentRect 244.IBPluginDependency 244.IBWindowTemplateEditedContentRect 244.ImportedFromIB2 244.editorWindowContentRectSynchronizationRect + 244.lastResizeAction 244.windowTemplate.hasMaxSize 244.windowTemplate.hasMinSize 244.windowTemplate.maxSize @@ -2971,12 +3170,24 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 299.IBPluginDependency 299.ImportedFromIB2 300295.IBShouldRemoveOnLegacySave - 300296.IBPluginDependency - 300296.ImportedFromIB2 - 300298.IBPluginDependency - 300298.ImportedFromIB2 300330.IBPluginDependency 300330.ImportedFromIB2 + 300337.IBPluginDependency + 300337.ImportedFromIB2 + 300338.IBPluginDependency + 300338.ImportedFromIB2 + 300358.IBPluginDependency + 300358.ImportedFromIB2 + 300359.IBPluginDependency + 300359.ImportedFromIB2 + 300362.IBPluginDependency + 300362.ImportedFromIB2 + 300364.IBPluginDependency + 300364.ImportedFromIB2 + 300368.IBPluginDependency + 300368.ImportedFromIB2 + 300370.IBPluginDependency + 300370.ImportedFromIB2 305.IBPluginDependency 305.ImportedFromIB2 310.IBPluginDependency @@ -3152,10 +3363,24 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 com.apple.InterfaceBuilder.CocoaPlugin {{271, 666}, {301, 153}} + {{460, 353}, {484, 280}} com.apple.InterfaceBuilder.CocoaPlugin - {{184, 290}, {481, 345}} + {{460, 353}, {484, 280}} {{184, 290}, {481, 345}} + + YES + + YES + IBResizeActionFinalFrame + IBResizeActionInitialFrame + + + YES + {{182, 481}, {484, 280}} + {{182, 103}, {536, 658}} + + {3.40282e+38, 3.40282e+38} @@ -3169,11 +3394,11 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 {{100, 746}, {155, 33}} com.apple.InterfaceBuilder.CocoaPlugin - {{537, 545}, {454, 311}} + {{407, 545}, {454, 311}} com.apple.InterfaceBuilder.CocoaPlugin - {{537, 545}, {454, 311}} + {{407, 545}, {454, 311}} {{433, 406}, {486, 327}} @@ -3320,6 +3545,18 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + {{12, 633}, {218, 203}} com.apple.InterfaceBuilder.CocoaPlugin @@ -3356,7 +3593,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 - 300336 + 300394 @@ -3375,6 +3612,17 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 + + X11Controller + NSObject + + IBUserSource + + + + + + YES X11Controller NSObject @@ -3439,6 +3687,8 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 enable_keyequivs enable_tcp fake_buttons + focus_follows_mouse + focus_on_new_window prefs_panel sync_keymap toggle_fullscreen_item @@ -3460,6 +3710,8 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 NSButton NSButton NSButton + NSButton + NSButton NSPanel NSButton NSMenuItem @@ -3469,8 +3721,8 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4 - IBUserSource - + IBDocumentRelativeSource + ../../X11Controller.h diff --git a/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib index f60dcbacb..400ee5c28 100644 Binary files a/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib differ diff --git a/hw/xquartz/quartzCommon.h b/hw/xquartz/quartzCommon.h index 6379f9205..40c72b3c7 100644 --- a/hw/xquartz/quartzCommon.h +++ b/hw/xquartz/quartzCommon.h @@ -67,6 +67,7 @@ extern int quartzEventWriteFD; // User preferences used by Quartz modes extern int quartzRootless; extern int quartzUseSysBeep; +extern int focusOnNewWindow; extern int quartzUseAGL; extern int quartzEnableKeyEquivalents; @@ -90,17 +91,4 @@ int QuartzFSUseQDCursor(int depth); void QuartzBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask); void QuartzWakeupHandler(pointer blockData, int result, pointer pReadmask); -// Messages that can be sent to the main thread. -enum { - kQuartzServerHidden, - kQuartzServerStarted, - kQuartzServerDied, - kQuartzCursorUpdate, - kQuartzPostEvent, - kQuartzSetWindowMenu, - kQuartzSetWindowMenuCheck, - kQuartzSetFrontProcess, - kQuartzSetCanQuit -}; - #endif /* _QUARTZCOMMON_H */ diff --git a/hw/xquartz/quartzForeground.c b/hw/xquartz/quartzForeground.c index bfea642d1..f7cd967dc 100644 --- a/hw/xquartz/quartzForeground.c +++ b/hw/xquartz/quartzForeground.c @@ -36,7 +36,7 @@ int QuartzMoveToForeground() { ProcessSerialNumber psn = { 0, kCurrentProcess }; OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication); if( returnCode == 0) { - fprintf(stderr, "TransformProcessType: Success\n"); + /* fprintf(stderr, "TransformProcessType: Success\n"); */ SetFrontProcess(&psn); } else { fprintf(stderr, "TransformProcessType: Failure\n");