summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ui/cocoa.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 73cfafa524..c2984028c5 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -902,7 +902,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];
                 }
             }