Commit 13aefd30 authored by Peter Maydell's avatar Peter Maydell
Browse files

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: default avatarPeter Maydell <peter.maydell@linaro.org>
Message-id: 1403516125-14568-5-git-send-email-peter.maydell@linaro.org
parent f61c387e
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -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;