Show/hide the menu bar in fullscreen on mouse
cover Show/hide the menu bar in fullscreen on mouse
Minor change to make fullscreen mode in the Cocoa UI a little more convenient.
The menu bar is now made visible when the mouse is released (ungrabbed) making it accessible without having to leave fullscreen mode. Grabbing the mouse hides the menu.
Carwyn Ellis (1):
ui/cocoa: show/hide menu in fullscreen on mouse ungrab/grab
ui/cocoa.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/1 ui/cocoa: show/hide menu in fullscreen on mouse ungrab/grab
The menu bar is only accessible when the Cocoa UI is windowed. In order to allow the menu bar to be accessible in fullscreen mode, this change makes the menu visible when the mouse is ungrabbed.
When the mouse is grabbed the menu is hidden again.
--- ui/cocoa.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
ui/cocoa.m +6 -2
@@ -1037,7 +1037,9 @@ QemuCocoaView *cocoaView; { COCOA_DEBUG("QemuCocoaView: grabMouse\n"); - if (!isFullscreen) { + if (isFullscreen) { + [NSMenu setMenuBarVisible: FALSE]; + } else { if (qemu_name) [normalWindow setTitle:[NSString stringWithFormat:@"QEMU %s - (Press ctrl + alt + g to release Mouse)", qemu_name]]; else
@@ -1052,7 +1054,9 @@ QemuCocoaView *cocoaView; { COCOA_DEBUG("QemuCocoaView: ungrabMouse\n"); - if (!isFullscreen) { + if (isFullscreen) { + [NSMenu setMenuBarVisible: TRUE]; + } else { if (qemu_name) [normalWindow setTitle:[NSString stringWithFormat:@"QEMU %s", qemu_name]]; else
Signature · 1 line
2.34.1
Re: [PATCH 1/1] ui/cocoa: show/hide menu in fullscreen on mouse ungrab/grab
Quoted 27 lines · Carwyn Ellis
The menu bar is only accessible when the Cocoa UI is windowed. In order to allow the menu bar to be accessible in fullscreen mode, this change makes the menu visible when the mouse is ungrabbed.
When the mouse is grabbed the menu is hidden again.
Signed-off-by Carwyn Ellis <[email protected]>--- ui/cocoa.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)ui/cocoa.m +3
-1@@ -1037,7 +1037,9 @@ QemuCocoaView *cocoaView; { COCOA_DEBUG("QemuCocoaView: grabMouse\n"); - if (!isFullscreen) { + if (isFullscreen) { + [NSMenu setMenuBarVisible: FALSE]; + } else { if (qemu_name) [normalWindow setTitle:[NSString stringWithFormat:@"QEMU %s - (Press ctrl + alt + g to release Mouse)", qemu_name]]; else
ui/cocoa.m QemuCocoaView *cocoaView; · line 1062
Quoted 10 lines
ui/cocoa.m +3
-1@@ -1052,7 +1054,9 @@ QemuCocoaView *cocoaView; { COCOA_DEBUG("QemuCocoaView: ungrabMouse\n"); - if (!isFullscreen) { + if (isFullscreen) { + [NSMenu setMenuBarVisible: TRUE]; + } else { if (qemu_name) [normalWindow setTitle:[NSString stringWithFormat:@"QEMU %s", qemu_name]]; else
[QemuCocoaView -toggleFullscreen:] also has the calls to [NSMenu setMenuBarVisible:], which should be removed.
Regards,
Akihiko Odaki
Re: [PATCH 1/1] ui/cocoa: show/hide menu in fullscreen on mouse ungrab/grab
Thanks, taking a look now and will push up another patch once I’ve tested the changes.
Regards
Carwyn
Quoted 40 lines · Akihiko Odaki
Quoted 23 lines · Carwyn Ellis
The menu bar is only accessible when the Cocoa UI is windowed. In order to allow the menu bar to be accessible in fullscreen mode, this change makes the menu visible when the mouse is ungrabbed.
When the mouse is grabbed the menu is hidden again.Signed-off-by Carwyn Ellis <[email protected]>--- ui/cocoa.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)ui/cocoa.m +3
-0@@ -1037,7 +1037,9 @@ QemuCocoaView *cocoaView; { COCOA_DEBUG("QemuCocoaView: grabMouse\n"); - if (!isFullscreen) { + if (isFullscreen) { + [NSMenu setMenuBarVisible: FALSE]; + } else { if (qemu_name) [normalWindow setTitle:[NSString stringWithFormat:@"QEMU %s - (Press ctrl + alt + g to release Mouse)", qemu_name]]; elseui/cocoa.m QemuCocoaView *cocoaView; · line 1062
Quoted 9 lines
ui/cocoa.m +3
-0@@ -1052,7 +1054,9 @@ QemuCocoaView *cocoaView; { COCOA_DEBUG("QemuCocoaView: ungrabMouse\n"); - if (!isFullscreen) { + if (isFullscreen) { + [NSMenu setMenuBarVisible: TRUE]; + } else { if (qemu_name) [normalWindow setTitle:[NSString stringWithFormat:@"QEMU %s", qemu_name]]; else[QemuCocoaView -toggleFullscreen:] also has the calls to [NSMenu setMenuBarVisible:], which should be removed.
Regards,
Akihiko Odaki