All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Show/hide the menu bar in fullscreen on mouse
@ 2022-01-03 11:45 Carwyn Ellis
  2022-01-03 11:45 ` [PATCH 1/1] ui/cocoa: show/hide menu in fullscreen on mouse ungrab/grab Carwyn Ellis
  0 siblings, 1 reply; 4+ messages in thread
From: Carwyn Ellis @ 2022-01-03 11:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, peter.maydell, Carwyn Ellis

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(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] ui/cocoa: show/hide menu in fullscreen on mouse ungrab/grab
  2022-01-03 11:45 [PATCH 0/1] Show/hide the menu bar in fullscreen on mouse Carwyn Ellis
@ 2022-01-03 11:45 ` Carwyn Ellis
  2022-02-18 18:42   ` Akihiko Odaki
  0 siblings, 1 reply; 4+ messages in thread
From: Carwyn Ellis @ 2022-01-03 11:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, peter.maydell, 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 <carwynellis@gmail.com>
---
 ui/cocoa.m | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 69745c483b..42dcf47da4 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -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
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] ui/cocoa: show/hide menu in fullscreen on mouse ungrab/grab
  2022-01-03 11:45 ` [PATCH 1/1] ui/cocoa: show/hide menu in fullscreen on mouse ungrab/grab Carwyn Ellis
@ 2022-02-18 18:42   ` Akihiko Odaki
  2022-04-10 16:50     ` Carwyn Ellis
  0 siblings, 1 reply; 4+ messages in thread
From: Akihiko Odaki @ 2022-02-18 18:42 UTC (permalink / raw)
  To: Carwyn Ellis, qemu-devel; +Cc: qemu-trivial, peter.maydell

On 2022/01/03 20:45, Carwyn Ellis wrote:
> 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 <carwynellis@gmail.com>
> ---
>   ui/cocoa.m | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/ui/cocoa.m b/ui/cocoa.m
> index 69745c483b..42dcf47da4 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -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

[QemuCocoaView -toggleFullscreen:] also has the calls to [NSMenu 
setMenuBarVisible:], which should be removed.

Regards,
Akihiko Odaki


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] ui/cocoa: show/hide menu in fullscreen on mouse ungrab/grab
  2022-02-18 18:42   ` Akihiko Odaki
@ 2022-04-10 16:50     ` Carwyn Ellis
  0 siblings, 0 replies; 4+ messages in thread
From: Carwyn Ellis @ 2022-04-10 16:50 UTC (permalink / raw)
  To: Akihiko Odaki; +Cc: qemu-trivial, peter.maydell, qemu-devel

Thanks, taking a look now and will push up another patch once I’ve tested the changes.

Regards
Carwyn

> On 18 Feb 2022, at 18:42, Akihiko Odaki <akihiko.odaki@gmail.com> wrote:
> 
> On 2022/01/03 20:45, Carwyn Ellis wrote:
>> 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 <carwynellis@gmail.com>
>> ---
>>  ui/cocoa.m | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>> diff --git a/ui/cocoa.m b/ui/cocoa.m
>> index 69745c483b..42dcf47da4 100644
>> --- a/ui/cocoa.m
>> +++ b/ui/cocoa.m
>> @@ -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
> 
> [QemuCocoaView -toggleFullscreen:] also has the calls to [NSMenu setMenuBarVisible:], which should be removed.
> 
> Regards,
> Akihiko Odaki



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-10 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 11:45 [PATCH 0/1] Show/hide the menu bar in fullscreen on mouse Carwyn Ellis
2022-01-03 11:45 ` [PATCH 1/1] ui/cocoa: show/hide menu in fullscreen on mouse ungrab/grab Carwyn Ellis
2022-02-18 18:42   ` Akihiko Odaki
2022-04-10 16:50     ` Carwyn Ellis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.