mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 21:33:12 +00:00
Mac OS X: Hide native mouse cursor (related to issue 350)
This commit is contained in:
parent
5c4c155dea
commit
d3aa22ac12
@ -178,6 +178,9 @@ static int osx_mouse_init(void)
|
|||||||
osx_emulate_mouse_buttons = (max_buttons == 1) ? TRUE : FALSE;
|
osx_emulate_mouse_buttons = (max_buttons == 1) ? TRUE : FALSE;
|
||||||
_unix_unlock_mutex(osx_event_mutex);
|
_unix_unlock_mutex(osx_event_mutex);
|
||||||
|
|
||||||
|
_mouse_on = TRUE;
|
||||||
|
[NSCursor performSelectorOnMainThread: @selector(hide) withObject: nil waitUntilDone: NO];
|
||||||
|
|
||||||
return max_buttons;
|
return max_buttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,7 +347,6 @@ int osx_mouse_show(BITMAP *bmp, int x, int y)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
osx_change_cursor(requested_cursor);
|
osx_change_cursor(requested_cursor);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,7 +223,10 @@ void osx_event_handler()
|
|||||||
mx = point.x;
|
mx = point.x;
|
||||||
my = frame.size.height - point.y;
|
my = frame.size.height - point.y;
|
||||||
buttons = 0;
|
buttons = 0;
|
||||||
_mouse_on = TRUE;
|
if (!_mouse_on) {
|
||||||
|
_mouse_on = TRUE;
|
||||||
|
[NSCursor performSelectorOnMainThread: @selector(hide) withObject: nil waitUntilDone: NO];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (osx_window)
|
if (osx_window)
|
||||||
@ -292,8 +295,11 @@ void osx_event_handler()
|
|||||||
mx = point.x;
|
mx = point.x;
|
||||||
my = frame.size.height - point.y;
|
my = frame.size.height - point.y;
|
||||||
buttons = 0;
|
buttons = 0;
|
||||||
_mouse_on = TRUE;
|
|
||||||
gotmouseevent = YES;
|
gotmouseevent = YES;
|
||||||
|
if (!_mouse_on) {
|
||||||
|
_mouse_on = TRUE;
|
||||||
|
[NSCursor performSelectorOnMainThread: @selector(hide) withObject: nil waitUntilDone: NO];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[NSApp sendEvent: event];
|
[NSApp sendEvent: event];
|
||||||
@ -302,8 +308,11 @@ void osx_event_handler()
|
|||||||
case NSMouseExited:
|
case NSMouseExited:
|
||||||
if ([event trackingNumber] == osx_mouse_tracking_rect) {
|
if ([event trackingNumber] == osx_mouse_tracking_rect) {
|
||||||
if (_mouse_installed) {
|
if (_mouse_installed) {
|
||||||
_mouse_on = FALSE;
|
|
||||||
gotmouseevent = YES;
|
gotmouseevent = YES;
|
||||||
|
if (_mouse_on) {
|
||||||
|
_mouse_on = FALSE;
|
||||||
|
[NSCursor performSelectorOnMainThread: @selector(unhide) withObject: nil waitUntilDone: NO];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[NSApp sendEvent: event];
|
[NSApp sendEvent: event];
|
||||||
|
@ -56,7 +56,7 @@ int _mouse_y = 0;
|
|||||||
int _mouse_z = 0;
|
int _mouse_z = 0;
|
||||||
int _mouse_w = 0;
|
int _mouse_w = 0;
|
||||||
int _mouse_b = 0;
|
int _mouse_b = 0;
|
||||||
int _mouse_on = TRUE;
|
int _mouse_on = FALSE;
|
||||||
|
|
||||||
static int mon = TRUE;
|
static int mon = TRUE;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user