qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 4/4] ui/cocoa: Honour -show-cursor command line optio


From: Peter Maydell
Subject: [Qemu-devel] [PULL 4/4] ui/cocoa: Honour -show-cursor command line option
Date: Mon, 30 Jun 2014 13:49:55 +0100

Honour the -show-cursor command line option (which forces the mouse pointer
to always be displayed even when input is grabbed) in the Cocoa UI backend.

Signed-off-by: Peter Maydell <address@hidden>
Message-id: address@hidden
---
 ui/cocoa.m | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 06951d0..3147178 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -323,6 +323,22 @@ QemuCocoaView *cocoaView;
     return (p.x > -1 && p.x < screen.width && p.y > -1 && p.y < screen.height);
 }
 
+- (void) hideCursor
+{
+    if (!cursor_hide) {
+        return;
+    }
+    [NSCursor hide];
+}
+
+- (void) unhideCursor
+{
+    if (!cursor_hide) {
+        return;
+    }
+    [NSCursor unhide];
+}
+
 - (void) drawRect:(NSRect) rect
 {
     COCOA_DEBUG("QemuCocoaView: drawRect\n");
@@ -735,7 +751,7 @@ QemuCocoaView *cocoaView;
         else
             [normalWindow setTitle:@"QEMU - (Press ctrl + alt to release 
Mouse)"];
     }
-    [NSCursor hide];
+    [self hideCursor];
     if (!isAbsoluteEnabled) {
         isMouseDeassociated = TRUE;
         CGAssociateMouseAndMouseCursorPosition(FALSE);
@@ -753,7 +769,7 @@ QemuCocoaView *cocoaView;
         else
             [normalWindow setTitle:@"QEMU"];
     }
-    [NSCursor unhide];
+    [self unhideCursor];
     if (isMouseDeassociated) {
         CGAssociateMouseAndMouseCursorPosition(TRUE);
         isMouseDeassociated = FALSE;
-- 
1.9.1




reply via email to

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