[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] input-linux: Delay grab toggle if keys are pressed
From: |
Rainer Müller |
Subject: |
Re: [PATCH 1/2] input-linux: Delay grab toggle if keys are pressed |
Date: |
Sun, 9 May 2021 13:43:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.23) Gecko/20090925 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 |
On 04/05/2021 11.14, Gerd Hoffmann wrote:
> On Sat, May 01, 2021 at 09:06:21PM +0200, Rainer Müller wrote:
>> When multiple keyboards are passed to the guest with input-linux, there
>> could still be keys pressed on the other keyboard when toggling grab.
>> Delay toggling grab on the other keyboard until all keys are released,
>> otherwise keys could be stuck on host without a key up event.
>
> Hmm, if you have two keyboards plugged into your machine, why would you
> assign both to a virtual machine? Instead of simply using one for the
> host and one for the guest?
Fair enough. I only noticed the possibility during testing. I plugged in
a second keyboard for development to avoid locking myself out and passed
only one. Then I became confident to pass them both, but mostly because
I already had them connected. I agree it does not seem like a typical
setup...
This was the only code path that did not check !il->keycount before
calling input_linux_toggle_grab(), so I added it here as well. Maybe it
would make sense to move the condition into the function?
Rainer