2021年3月15日(月) 16:32 Gerd Hoffmann <kra...@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 >