All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH] ui/cocoa: Do not raise keys before QEMU resigns active
Date: Mon, 15 Mar 2021 19:15:26 +0900	[thread overview]
Message-ID: <CAMVc7JWu-Hp11X48Fe71A5dYcHkn0ce3wRr27mqyj9gPcJt3Lw@mail.gmail.com> (raw)
In-Reply-To: <20210315073233.edxuqhu7m2lmxgzg@sirius.home.kraxel.org>

2021年3月15日(月) 16:32 Gerd Hoffmann <kraxel@redhat.com>:
>
> On Sun, Mar 14, 2021 at 04:01:47PM +0900, Akihiko Odaki wrote:
> > ui/cocoa used to raise all keys before it resigns active to prevent a
> > stuck key problem caused by key up events it does not see while it is
> > inactive. The problem is solved by checking -[NSEvent modifierFlags] in
> > commit 6d73bb643aa725348aabe6a885ac5fb0b7f70252, which is better
> > because it handles the case that key *down* events are missed while it
> > is inactive.
>
> Well, I think it is a good idea to virtually lift all keys when the
> application goes inactive.  Does this cause any actual problems?

No, but ui/cocoa already has so many states and I don't think there is
a room for extra complexity, especially when considering the code
checking -[NSEvent modifierFlags]. Keyboard event management concerns
iothread mutex, different handling of modifier and normal keys and
some special keyboard shortcuts. -[QemuCocoaView raiseAllKeys]
introduces exceptional behaviors to them just to raise normal keys,
something ui/cocoa didn't before introducing QemuKbdState.

Regards,
Akihiko Odaki

>
> Worst case should be that we send an extra keyup + keydown if the
> qemu goes through a active -> inactive -> active cycle while a modifier
> key is down, which you probably wouldn't even notice unless you log all
> key events inside the guest.
>
> take care,
>   Gerd
>


      reply	other threads:[~2021-03-15 10:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-14  7:01 [PATCH] ui/cocoa: Do not raise keys before QEMU resigns active Akihiko Odaki
2021-03-14 12:55 ` BALATON Zoltan
2021-03-14 18:07   ` Akihiko Odaki
2021-03-15  7:32 ` Gerd Hoffmann
2021-03-15 10:15   ` 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=CAMVc7JWu-Hp11X48Fe71A5dYcHkn0ce3wRr27mqyj9gPcJt3Lw@mail.gmail.com \
    --to=akihiko.odaki@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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.