qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@gmail.com>
To: Carwyn Ellis <carwynellis@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org
Subject: Re: [PATCH 1/1] ui/cocoa: show/hide menu in fullscreen on mouse ungrab/grab
Date: Sat, 19 Feb 2022 03:42:15 +0900	[thread overview]
Message-ID: <84cbfcca-648c-8e4c-9966-28086acfd5c0@gmail.com> (raw)
In-Reply-To: <20220103114515.24020-2-carwynellis@gmail.com>

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


  reply	other threads:[~2022-02-18 18:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-04-10 16:50     ` Carwyn Ellis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84cbfcca-648c-8e4c-9966-28086acfd5c0@gmail.com \
    --to=akihiko.odaki@gmail.com \
    --cc=carwynellis@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).