From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1b1x-0007kD-2J for qemu-devel@nongnu.org; Mon, 30 Jun 2014 08:49:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1b1w-0006r6-2t for qemu-devel@nongnu.org; Mon, 30 Jun 2014 08:49:57 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1b1v-0006qf-TC for qemu-devel@nongnu.org; Mon, 30 Jun 2014 08:49:56 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1X1b1v-0008VP-6v for qemu-devel@nongnu.org; Mon, 30 Jun 2014 13:49:55 +0100 From: Peter Maydell Date: Mon, 30 Jun 2014 13:49:55 +0100 Message-Id: <1404132595-32651-5-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1404132595-32651-1-git-send-email-peter.maydell@linaro.org> References: <1404132595-32651-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 4/4] ui/cocoa: Honour -show-cursor command line option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Message-id: 1403516125-14568-5-git-send-email-peter.maydell@linaro.org --- 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