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 2/2] ui/cocoa: release mouse when user switches away from QEMU window
Date: Sat, 19 Feb 2022 03:33:40 +0900	[thread overview]
Message-ID: <5bf923f3-c733-ef73-567f-342c2c51da41@gmail.com> (raw)
In-Reply-To: <20220102174153.70043-3-carwynellis@gmail.com>

Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com>

On 2022/01/03 2:41, Carwyn Ellis wrote:
> This resolves an issue where using command-tab to switch between QEMU
> and other windows on the host can leave the mouse pointer visible.
> 
> By releasing the mouse when the user switches away, the user must left
> click on the QEMU window when switching back in order to hide the
> pointer and return control to the guest.
> 
> This appraoch ensures that the calls to NSCursor hide and unhide are
> always balanced and thus work correctly when invoked.
> 
> Signed-off-by: Carwyn Ellis <carwynellis@gmail.com>
> ---
>   ui/cocoa.m | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/ui/cocoa.m b/ui/cocoa.m
> index 01045d6698..3f7af4a8fa 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -1243,6 +1243,7 @@ QemuCocoaView *cocoaView;
>   - (void) applicationWillResignActive: (NSNotification *)aNotification
>   {
>       COCOA_DEBUG("QemuCocoaAppController: applicationWillResignActive\n");
> +    [cocoaView ungrabMouse];
>       [cocoaView raiseAllKeys];
>   }
>   
> @@ -2052,6 +2053,7 @@ static void cocoa_display_init(DisplayState *ds, DisplayOptions *opts)
>               [(QemuCocoaAppController *)[[NSApplication sharedApplication] delegate] toggleFullScreen: nil];
>           });
>       }
> +
>       if (opts->has_show_cursor && opts->show_cursor) {
>           cursor_hide = 0;
>       }



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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-02 17:41 [PATCH 0/2] ui/cocoa: Add option to disable left command and hide cursor on click Carwyn Ellis
2022-01-02 17:41 ` [PATCH 1/2] ui/cocoa: add option to disable left-command forwarding to guest Carwyn Ellis
2022-02-18 18:33   ` Akihiko Odaki
2022-02-18 18:55   ` Peter Maydell
2022-02-18 20:21     ` Philippe Mathieu-Daudé via
2022-03-11 12:46       ` Markus Armbruster
2022-01-02 17:41 ` [PATCH 2/2] ui/cocoa: release mouse when user switches away from QEMU window Carwyn Ellis
2022-02-18 18:33   ` Akihiko Odaki [this message]

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=5bf923f3-c733-ef73-567f-342c2c51da41@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).