aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-06-22 16:09:52 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-06-23 10:41:36 +0100
commitb75925224cec2f083958ee10ffaddf875ed53c16 (patch)
tree38d4cb8bd6f19e3a61705838ab484cef9f349b1a
parent12379e370f318a9af846f97c00975820241b7e96 (diff)
downloadqemu-arm-b75925224cec2f083958ee10ffaddf875ed53c16.tar.gz
ui/cocoa: Honour -show-cursor command line option
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 <peter.maydell@linaro.org>
-rw-r--r--ui/cocoa.m20
1 files changed, 18 insertions, 2 deletions
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 06951d03f0..3147178118 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;