diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-10-31 20:03:34 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-10-31 20:03:34 -0700 |
commit | 637a9f4bd1ff2b55c870a08ead4940df0f9818e5 (patch) | |
tree | dbcf118749067b418ea84e1b2a40bad50aefd254 /hw/xquartz | |
parent | ea71710aaa7166ab510abe70f2dc47942de0ead7 (diff) |
XQuartz: Add option to allow access to the menu in fullscreen mode
Diffstat (limited to 'hw/xquartz')
-rw-r--r-- | hw/xquartz/X11Application.h | 3 | ||||
-rw-r--r-- | hw/xquartz/X11Application.m | 26 | ||||
-rw-r--r-- | hw/xquartz/X11Controller.h | 1 | ||||
-rw-r--r-- | hw/xquartz/X11Controller.m | 29 | ||||
-rw-r--r-- | hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib | 76 | ||||
-rw-r--r-- | hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib | bin | 41183 -> 41815 bytes |
6 files changed, 101 insertions, 34 deletions
diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h index dd25fb070..91debd663 100644 --- a/hw/xquartz/X11Application.h +++ b/hw/xquartz/X11Application.h @@ -73,7 +73,7 @@ void X11ApplicationShowHideMenubar (int state); void X11ApplicationMain(int argc, char **argv, char **envp); extern int X11EnableKeyEquivalents; -extern int quartzHasRoot, quartzEnableRootless; +extern int quartzHasRoot, quartzEnableRootless, quartzFullscreenMenu; #define APP_PREFS "org.x.X11" @@ -82,6 +82,7 @@ extern int quartzHasRoot, quartzEnableRootless; #define PREFS_SYSBEEP "enable_system_beep" #define PREFS_KEYEQUIVS "enable_key_equivalents" #define PREFS_FULLSCREEN_HOTKEYS "fullscreen_hotkeys" +#define PREFS_FULLSCREEN_MENU "fullscreen_menu" #define PREFS_SYNC_KEYMAP "sync_keymap" #define PREFS_DEPTH "depth" #define PREFS_NO_AUTH "no_auth" diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 1bf429a96..ce3e5fced 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -59,7 +59,7 @@ #define ProximityIn 0 #define ProximityOut 1 -int X11EnableKeyEquivalents = TRUE; +int X11EnableKeyEquivalents = TRUE, quartzFullscreenMenu = FALSE; int quartzHasRoot = FALSE, quartzEnableRootless = TRUE; static TISInputSourceRef last_key_layout; @@ -352,14 +352,11 @@ static void message_kit_thread (SEL selector, NSObject *arg) { } - (void) show_hide_menubar:(NSNumber *)state { -#if defined(__LP64__) - /* Also shows/hides the dock */ - if ([state boolValue]) SetSystemUIMode(kUIModeNormal, 0); - else SetSystemUIMode(kUIModeAllHidden, 0); -#else - if ([state boolValue]) ShowMenuBar (); - else HideMenuBar (); -#endif + /* Also shows/hides the dock */ + if ([state boolValue]) + SetSystemUIMode(kUIModeNormal, 0); + else + SetSystemUIMode(kUIModeAllHidden, quartzFullscreenMenu ? kUIOptionAutoShowMenuBar : 0); // kUIModeAllSuppressed or kUIOptionAutoShowMenuBar can be used to allow "mouse-activation" } @@ -637,14 +634,15 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { const char *tem; quartzUseSysBeep = [self prefs_get_boolean:@PREFS_SYSBEEP - default:quartzUseSysBeep]; + default:quartzUseSysBeep]; quartzEnableRootless = [self prefs_get_boolean:@PREFS_ROOTLESS - default:quartzEnableRootless]; + default:quartzEnableRootless]; + quartzFullscreenMenu = [self prefs_get_boolean:@PREFS_FULLSCREEN_MENU + default:quartzFullscreenMenu]; quartzFullscreenDisableHotkeys = ![self prefs_get_boolean: - @PREFS_FULLSCREEN_HOTKEYS default: - !quartzFullscreenDisableHotkeys]; + @PREFS_FULLSCREEN_HOTKEYS default:!quartzFullscreenDisableHotkeys]; darwinFakeButtons = [self prefs_get_boolean:@PREFS_FAKEBUTTONS - default:darwinFakeButtons]; + default:darwinFakeButtons]; if (darwinFakeButtons) { const char *fake2, *fake3; diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h index a3e208673..bb9adb1ce 100644 --- a/hw/xquartz/X11Controller.h +++ b/hw/xquartz/X11Controller.h @@ -41,6 +41,7 @@ IBOutlet NSButton *fake_buttons; IBOutlet NSButton *enable_fullscreen; + IBOutlet NSButton *enable_fullscreen_menu; IBOutlet NSButton *use_sysbeep; IBOutlet NSButton *enable_keyequivs; IBOutlet NSButton *sync_keymap; diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index d4958b507..2668e1ed5 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -592,14 +592,15 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMPreviousWindow); } -- (IBAction) enable_fullscreen_changed:sender -{ - int value = ![enable_fullscreen intValue]; +- (IBAction) enable_fullscreen_changed:sender { + int value = ![enable_fullscreen intValue]; - DarwinSendDDXEvent(kXquartzSetRootless, 1, value); - - [NSApp prefs_set_boolean:@PREFS_ROOTLESS value:value]; - [NSApp prefs_synchronize]; + [enable_fullscreen_menu setEnabled:!value]; + + DarwinSendDDXEvent(kXquartzSetRootless, 1, value); + + [NSApp prefs_set_boolean:@PREFS_ROOTLESS value:value]; + [NSApp prefs_synchronize]; } - (IBAction) toggle_fullscreen:sender @@ -618,14 +619,16 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row quartzUseSysBeep = [use_sysbeep intValue]; X11EnableKeyEquivalents = [enable_keyequivs intValue]; darwinSyncKeymap = [sync_keymap intValue]; + quartzFullscreenMenu = [enable_fullscreen_menu intValue]; /* after adding prefs here, also add to [X11Application read_defaults] and prefs_show */ - + [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_FULLSCREEN_MENU value:quartzFullscreenMenu]; [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]]; @@ -634,13 +637,13 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row [NSApp prefs_set_integer:@PREFS_DEPTH value:[depth selectedTag]]; BOOL pbproxy_active = [sync_pasteboard intValue]; - + [NSApp prefs_set_boolean:@PREFS_SYNC_PB value:pbproxy_active]; [NSApp prefs_set_boolean:@PREFS_SYNC_PB_TO_CLIPBOARD value:[sync_pasteboard_to_clipboard intValue]]; [NSApp prefs_set_boolean:@PREFS_SYNC_PB_TO_PRIMARY value:[sync_pasteboard_to_primary intValue]]; [NSApp prefs_set_boolean:@PREFS_SYNC_CLIPBOARD_TO_PB value:[sync_clipboard_to_pasteboard intValue]]; [NSApp prefs_set_boolean:@PREFS_SYNC_PRIMARY_ON_SELECT value:[sync_primary_immediately intValue]]; - + [NSApp prefs_synchronize]; [sync_pasteboard_to_clipboard setEnabled:pbproxy_active]; @@ -686,9 +689,11 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row // setEnabled doesn't do this... [sync_text1 setTextColor:pbproxy_active ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]]; [sync_text2 setTextColor:pbproxy_active ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]]; - - [enable_fullscreen setIntValue:!quartzEnableRootless]; + [enable_fullscreen setIntValue:!quartzEnableRootless]; + [enable_fullscreen_menu setEnabled:!quartzEnableRootless]; + [enable_fullscreen_menu setIntValue:quartzFullscreenMenu]; + [prefs_panel makeKeyAndOrderFront:sender]; } diff --git a/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib index 58a13361e..8f7c50306 100644 --- a/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib +++ b/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib @@ -8,6 +8,7 @@ <string key="IBDocument.HIToolboxVersion">352.00</string> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> + <integer value="348"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -400,7 +401,7 @@ <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string> <string key="NSWindowContentMinSize">{320, 240}</string> <object class="NSView" key="NSWindowView" id="941366957"> - <nil key="NSNextResponder"/> + <reference key="NSNextResponder"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -578,7 +579,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg</string> <object class="NSButton" id="418227126"> <reference key="NSNextResponder" ref="515308735"/> <int key="NSvFlags">256</int> - <string key="NSFrame">{{18, 83}, {402, 18}}</string> + <string key="NSFrame">{{18, 63}, {402, 18}}</string> <reference key="NSSuperview" ref="515308735"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="1016069354"> @@ -599,7 +600,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg</string> <object class="NSTextField" id="1039016593"> <reference key="NSNextResponder" ref="515308735"/> <int key="NSvFlags">256</int> - <string key="NSFrame">{{36, 49}, {385, 28}}</string> + <string key="NSFrame">{{36, 29}, {385, 28}}</string> <reference key="NSSuperview" ref="515308735"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="624655599"> @@ -744,7 +745,7 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg</string> <object class="NSButtonCell" key="NSCell" id="631531164"> <int key="NSCellFlags">67239424</int> <int key="NSCellFlags2">0</int> - <string key="NSContents">Full screen mode</string> + <string key="NSContents">Full-screen mode</string> <reference key="NSSupport" ref="463863101"/> <reference key="NSControlView" ref="477203622"/> <int key="NSButtonFlags">1211912703</int> @@ -756,6 +757,27 @@ IG9yIHJpZ2h0IG1vdXNlIGJ1dHRvbnMuCg</string> <int key="NSPeriodicInterval">25</int> </object> </object> + <object class="NSButton" id="57246850"> + <reference key="NSNextResponder" ref="515308735"/> + <int key="NSvFlags">256</int> + <string key="NSFrame">{{37, 83}, {409, 23}}</string> + <reference key="NSSuperview" ref="515308735"/> + <bool key="NSEnabled">YES</bool> + <object class="NSButtonCell" key="NSCell" id="917248662"> + <int key="NSCellFlags">67239424</int> + <int key="NSCellFlags2">0</int> + <string key="NSContents">Auto-show menu bar in full-screen mode</string> + <reference key="NSSupport" ref="463863101"/> + <reference key="NSControlView" ref="57246850"/> + <int key="NSButtonFlags">1211912703</int> + <int key="NSButtonFlags2">2</int> + <reference key="NSAlternateImage" ref="391434389"/> + <string key="NSAlternateContents"/> + <string key="NSKeyEquivalent"/> + <int key="NSPeriodicDelay">200</int> + <int key="NSPeriodicInterval">25</int> + </object> + </object> <object class="NSTextField" id="298603383"> <reference key="NSNextResponder" ref="515308735"/> <int key="NSvFlags">256</int> @@ -1195,6 +1217,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> </object> </object> <string key="NSFrameSize">{484, 308}</string> + <reference key="NSSuperview"/> </object> <string key="NSScreenRect">{{0, 0}, {1280, 938}}</string> <string key="NSMinSize">{320, 262}</string> @@ -2108,6 +2131,22 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> </object> <int key="connectionID">300471</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">enable_fullscreen_menu</string> + <reference key="source" ref="485884620"/> + <reference key="destination" ref="57246850"/> + </object> + <int key="connectionID">300474</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">prefs_changed:</string> + <reference key="source" ref="485884620"/> + <reference key="destination" ref="57246850"/> + </object> + <int key="connectionID">300475</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -2520,13 +2559,14 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> <reference key="object" ref="515308735"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="418227126"/> - <reference ref="1039016593"/> <reference ref="709074847"/> <reference ref="201731424"/> <reference ref="86150604"/> <reference ref="477203622"/> + <reference ref="57246850"/> <reference ref="298603383"/> + <reference ref="418227126"/> + <reference ref="1039016593"/> </object> <reference key="parent" ref="960678392"/> </object> @@ -3224,6 +3264,20 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> <reference key="object" ref="994587858"/> <reference key="parent" ref="522511724"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">300472</int> + <reference key="object" ref="57246850"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="917248662"/> + </object> + <reference key="parent" ref="515308735"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">300473</int> + <reference key="object" ref="917248662"/> + <reference key="parent" ref="57246850"/> + </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> @@ -3401,6 +3455,9 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> <string>300459.IBPluginDependency</string> <string>300459.ImportedFromIB2</string> <string>300460.IBPluginDependency</string> + <string>300472.IBPluginDependency</string> + <string>300472.ImportedFromIB2</string> + <string>300473.IBPluginDependency</string> <string>305.IBPluginDependency</string> <string>305.ImportedFromIB2</string> <string>310.IBPluginDependency</string> @@ -3690,6 +3747,9 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <reference ref="9"/> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> @@ -3821,7 +3881,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> </object> </object> <nil key="sourceID"/> - <int key="maxID">300471</int> + <int key="maxID">300475</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -3913,6 +3973,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> <string>dock_window_separator</string> <string>enable_auth</string> <string>enable_fullscreen</string> + <string>enable_fullscreen_menu</string> <string>enable_keyequivs</string> <string>enable_tcp</string> <string>fake_buttons</string> @@ -3949,6 +4010,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> <string>NSButton</string> <string>NSButton</string> <string>NSButton</string> + <string>NSButton</string> <string>NSPanel</string> <string>NSButton</string> <string>NSButton</string> diff --git a/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib Binary files differindex 1b5aa8838..097212409 100644 --- a/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib +++ b/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib |