Fix custom cursor disappearing on osx

This commit is contained in:
Guilherme Felipe 2018-05-09 19:49:45 -03:00
parent c294993d97
commit 48f9e6a05b
1 changed files with 8 additions and 5 deletions

View File

@ -541,7 +541,9 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
} }
- (void)cursorUpdate:(NSEvent *)event { - (void)cursorUpdate:(NSEvent *)event {
//setModeCursor(window, window->cursorMode); OS::CursorShape p_shape = OS_OSX::singleton->cursor_shape;
OS_OSX::singleton->cursor_shape = OS::CURSOR_MAX;
OS_OSX::singleton->set_cursor_shape(p_shape);
} }
static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) { static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) {
@ -656,11 +658,12 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) {
return; return;
if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode != OS::MOUSE_MODE_CAPTURED) if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode != OS::MOUSE_MODE_CAPTURED)
OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER); OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER);
if (OS_OSX::singleton->input) { if (OS_OSX::singleton->input)
OS_OSX::singleton->input->set_mouse_in_window(true); OS_OSX::singleton->input->set_mouse_in_window(true);
OS::CursorShape p_shape = OS_OSX::singleton->cursor_shape;
OS_OSX::singleton->cursor_shape = OS::CURSOR_MAX; OS_OSX::singleton->cursor_shape = OS::CURSOR_MAX;
OS_OSX::singleton->set_cursor_shape(OS::CURSOR_ARROW); OS_OSX::singleton->set_cursor_shape(p_shape);
}
} }
- (void)magnifyWithEvent:(NSEvent *)event { - (void)magnifyWithEvent:(NSEvent *)event {