All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: John Arbuckle <programmingkidx@gmail.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] ui/cocoa.m: fix absolute mode
Date: Sun, 1 Jul 2018 20:26:28 +0100	[thread overview]
Message-ID: <CAFEAcA94hE1h8cRCaGWW8id+ZNZs2N8ZJ+yjeJoZn6czePYxjA@mail.gmail.com> (raw)
In-Reply-To: <20180608200150.7032-1-programmingkidx@gmail.com>

On 8 June 2018 at 21:01, John Arbuckle <programmingkidx@gmail.com> wrote:
> Fix the cocoa front-end to correctly be able to use absolute mode.
>
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>

>          case NSEventTypeMouseMoved:
>              if (isAbsoluteEnabled) {
> -                if (![self screenContainsPoint:p] || ![[self window] isKeyWindow]) {
> +                if ([self mouseInWindow]) {
> +                    mouse_event = true;
> +                }
> +
> +                if (![self mouseInWindow] || ![[self window] isKeyWindow]) {
>                      if (isMouseGrabbed) {
>                          [self ungrabMouse];
>                      }
>                  } else {
> -                    if (!isMouseGrabbed) {
> +                    if (!isMouseGrabbed && [self mouseInWindow]) {
>                          [self grabMouse];
>                      }

We may well not need this part of the patch, but:
this change of condition from "!isMouseGrabbed" to
"!isMouseGrabbed && [self mouseInWindow]" is unnecessary.
This code is inside the "else" block for the preceding
"if (![self mouseInWindow] || ![[self window] isKeyWindow])",
so it is not possible to reach it if "[self mouseInWindow]"
returns false.

thanks
-- PMM

      parent reply	other threads:[~2018-07-01 19:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08 20:01 [Qemu-devel] [PATCH] ui/cocoa.m: fix absolute mode John Arbuckle
2018-06-18 11:18 ` Peter Maydell
2018-06-18 22:24   ` Programmingkid
2018-07-01 19:24     ` Peter Maydell
2018-07-01 19:26 ` Peter Maydell [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=CAFEAcA94hE1h8cRCaGWW8id+ZNZs2N8ZJ+yjeJoZn6czePYxjA@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@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 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.