qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2] ui/cocoa.m: fix sending mouse event to guest


From: Programmingkid
Subject: [Qemu-devel] [PATCH v2] ui/cocoa.m: fix sending mouse event to guest
Date: Sun, 1 Jan 2017 16:31:07 -0500

The mouse down event should not be sent to the guest if the mouse down event
causes QEMU to move the foreground from the background. This patch prevents
these activation clicks from going to the guest.

Signed-off-by: John Arbuckle <address@hidden>
---
v2 changes:
Fix a bug that caused fullscreen mode not to receive mouse events.

 ui/cocoa.m | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 26d4a1c..ae3f5a1 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -695,13 +695,13 @@ QemuCocoaView *cocoaView;
 
     if (mouse_event) {
         /* Don't send button events to the guest unless we've got a
-         * mouse grab or window focus. If we have neither then this event
-         * is the user clicking on the background window to activate and
-         * bring us to the front, which will be done by the sendEvent
-         * call below. We definitely don't want to pass that click through
-         * to the guest.
+         * mouse grab, window focus, or in fullscreen mode. If we have neither
+         * then this event is the user clicking on the background window to
+         * activate and bring us to the front, which will be done by the
+         * sendEvent call below. We definitely don't want to pass that click
+         * through to the guest.
          */
-        if ((isMouseGrabbed || [[self window] isKeyWindow]) &&
+        if (isMouseGrabbed && ([[self window] isKeyWindow] || isFullscreen) &&
             (last_buttons != buttons)) {
             static uint32_t bmap[INPUT_BUTTON__MAX] = {
                 [INPUT_BUTTON_LEFT]       = MOUSE_EVENT_LBUTTON,
-- 
2.7.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]