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 e6a61175a..fa7c532cc 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;
@@ -353,14 +353,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"
}
@@ -638,14 +635,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 @@
352.00
@@ -3401,6 +3455,9 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4
300459.IBPluginDependency
300459.ImportedFromIB2
300460.IBPluginDependency
+ 300472.IBPluginDependency
+ 300472.ImportedFromIB2
+ 300473.IBPluginDependency
305.IBPluginDependency
305.ImportedFromIB2
310.IBPluginDependency
@@ -3690,6 +3747,9 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
@@ -3821,7 +3881,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4
- 300471
+ 300475
@@ -3913,6 +3973,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4
dock_window_separator
enable_auth
enable_fullscreen
+ enable_fullscreen_menu
enable_keyequivs
enable_tcp
fake_buttons
@@ -3949,6 +4010,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4
NSButton
NSButton
NSButton
+ NSButton
NSPanel
NSButton
NSButton
diff --git a/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib
index 1b5aa8838..097212409 100644
Binary files a/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib differ