[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/20] ui/cocoa: Override windowDidResignKey
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 18/20] ui/cocoa: Override windowDidResignKey |
Date: |
Wed, 8 Mar 2023 00:47:09 +0100 |
From: Akihiko Odaki <akihiko.odaki@daynix.com>
This fixes pressed keys being stuck when the deck is clicked and the
window loses focus.
In the past, Gustavo Noronha Silva also had a patch to fix this issue
though it only ungrabs mouse and does not release keys, and depends on
another out-of-tree patch:
https://github.com/akihikodaki/qemu/pull/3/commits/e906a80147b1dc6d4f31b6a08064ef9871a2b76c
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20230228070946.12370-1-akihiko.odaki@daynix.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
ui/cocoa.m | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 289a2b193e..985a0f5069 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1330,10 +1330,15 @@ - (BOOL)windowShouldClose:(id)sender
return NO;
}
-/* Called when QEMU goes into the background */
-- (void) applicationWillResignActive: (NSNotification *)aNotification
+/*
+ * Called when QEMU goes into the background. Note that
+ * [-NSWindowDelegate windowDidResignKey:] is used here instead of
+ * [-NSApplicationDelegate applicationWillResignActive:] because it cannot
+ * detect that the window loses focus when the deck is clicked on macOS 13.2.1.
+ */
+- (void) windowDidResignKey: (NSNotification *)aNotification
{
- COCOA_DEBUG("QemuCocoaAppController: applicationWillResignActive\n");
+ COCOA_DEBUG("%s\n", __func__);
[cocoaView ungrabMouse];
[cocoaView raiseAllKeys];
}
--
2.38.1
- [PULL 13/20] hw/isa/vt82c686: Implement PCI IRQ routing, (continued)
- [PULL 13/20] hw/isa/vt82c686: Implement PCI IRQ routing, Philippe Mathieu-Daudé, 2023/03/07
- [PULL 14/20] hw/ppc/pegasos2: Fix PCI interrupt routing, Philippe Mathieu-Daudé, 2023/03/07
- [PULL 15/20] hw/usb/vt82c686-uhci-pci: Use PCI IRQ routing, Philippe Mathieu-Daudé, 2023/03/07
- [PULL 16/20] hw/audio/via-ac97: Basic implementation of audio playback, Philippe Mathieu-Daudé, 2023/03/07
- [PULL 17/20] hw/usb/ohci: Implement resume on connection status change, Philippe Mathieu-Daudé, 2023/03/07
- [PULL 19/20] memory: Dump HPA and access type of ramblocks, Philippe Mathieu-Daudé, 2023/03/07
- [PULL 20/20] log: Remove unneeded new line, Philippe Mathieu-Daudé, 2023/03/07
- [PULL 18/20] ui/cocoa: Override windowDidResignKey,
Philippe Mathieu-Daudé <=
- Re: [PULL 00/20] MIPS patches for 2023-03-07, Peter Maydell, 2023/03/09