Mac OS X: Hide native mouse cursor (related to issue 350)

This commit is contained in:
David Capello 2014-06-29 16:10:12 -03:00
parent 5c4c155dea
commit d3aa22ac12
3 changed files with 16 additions and 5 deletions

View File

@ -178,6 +178,9 @@ static int osx_mouse_init(void)
osx_emulate_mouse_buttons = (max_buttons == 1) ? TRUE : FALSE;
_unix_unlock_mutex(osx_event_mutex);
_mouse_on = TRUE;
[NSCursor performSelectorOnMainThread: @selector(hide) withObject: nil waitUntilDone: NO];
return max_buttons;
}
@ -344,7 +347,6 @@ int osx_mouse_show(BITMAP *bmp, int x, int y)
return -1;
osx_change_cursor(requested_cursor);
return 0;
}

View File

@ -223,7 +223,10 @@ void osx_event_handler()
mx = point.x;
my = frame.size.height - point.y;
buttons = 0;
_mouse_on = TRUE;
if (!_mouse_on) {
_mouse_on = TRUE;
[NSCursor performSelectorOnMainThread: @selector(hide) withObject: nil waitUntilDone: NO];
}
}
}
if (osx_window)
@ -292,8 +295,11 @@ void osx_event_handler()
mx = point.x;
my = frame.size.height - point.y;
buttons = 0;
_mouse_on = TRUE;
gotmouseevent = YES;
if (!_mouse_on) {
_mouse_on = TRUE;
[NSCursor performSelectorOnMainThread: @selector(hide) withObject: nil waitUntilDone: NO];
}
}
}
[NSApp sendEvent: event];
@ -302,8 +308,11 @@ void osx_event_handler()
case NSMouseExited:
if ([event trackingNumber] == osx_mouse_tracking_rect) {
if (_mouse_installed) {
_mouse_on = FALSE;
gotmouseevent = YES;
if (_mouse_on) {
_mouse_on = FALSE;
[NSCursor performSelectorOnMainThread: @selector(unhide) withObject: nil waitUntilDone: NO];
}
}
}
[NSApp sendEvent: event];

View File

@ -56,7 +56,7 @@ int _mouse_y = 0;
int _mouse_z = 0;
int _mouse_w = 0;
int _mouse_b = 0;
int _mouse_on = TRUE;
int _mouse_on = FALSE;
static int mon = TRUE;