[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/2] ui/cocoa: Fix mouse grabbing in fullscreen mode
From: |
Chen Zhang |
Subject: |
[Qemu-devel] [PATCH 2/2] ui/cocoa: Fix mouse grabbing in fullscreen mode for relative input device |
Date: |
Tue, 4 Jun 2019 17:36:48 +0800 |
In fullscreen mode, the window property of cocoaView may not be the key
window, and the current implementation would not re-grab cursor by left click
in fullscreen mode after ungrabbed in fullscreen mode with hot-key ctrl-opt-g.
This patch used value of isFullscreen as a short-cirtuit condition for
relative input device grabbing.
Signed-off-by: Chen Zhang <address@hidden>
---
ui/cocoa.m | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 474d44cb9f..aa7cf07368 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -901,7 +901,12 @@ QemuCocoaView *cocoaView;
case NSEventTypeLeftMouseUp:
mouse_event = true;
if (!isMouseGrabbed && [self screenContainsPoint:p]) {
- if([[self window] isKeyWindow]) {
+ /*
+ * In fullscreen mode, the window of cocoaView may not be the
+ * key window, therefore the position relative to the virtual
+ * screen alone will be sufficient.
+ */
+ if(isFullscreen || [[self window] isKeyWindow]) {
[self grabMouse];
}
}
--
2.21.0
- [Qemu-devel] [PATCH 0/2] ui/cocoa: Fix input device issues on Mojave, Chen Zhang, 2019/06/04
- [Qemu-devel] [PATCH 1/2] ui/cocoa: Fix absolute input device grabbing issue on Mojave, Chen Zhang, 2019/06/04
- [Qemu-devel] [PATCH 2/2] ui/cocoa: Fix mouse grabbing in fullscreen mode for relative input device,
Chen Zhang <=
- Re: [Qemu-devel] [PATCH 0/2] ui/cocoa: Fix input device issues on Mojave, no-reply, 2019/06/05
- Re: [Qemu-devel] [PATCH 0/2] ui/cocoa: Fix input device issues on Mojave, Peter Maydell, 2019/06/12
- [Qemu-devel] A patch has been merged in QEMU: [PATCH 0/2] ui/cocoa: Fix input device issues on Mojave, no-reply, 2019/06/13
- [Qemu-devel] A patch has been merged in QEMU: [PATCH 0/2] ui/cocoa: Fix input device issues on Mojave, no-reply, 2019/06/13