mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-27 03:16:58 +00:00
Fix more problems with OS X mouse cursor
Don’t hide native cursor or show custom cursor if the mouse is outside the main view.
This commit is contained in:
parent
72e2040c58
commit
3745f563d0
@ -345,6 +345,9 @@ int osx_mouse_set_sprite(BITMAP *sprite, int x, int y)
|
||||
*/
|
||||
int osx_mouse_show(BITMAP *bmp, int x, int y)
|
||||
{
|
||||
if (!_mouse_on)
|
||||
return -1;
|
||||
|
||||
/* Only draw on screen */
|
||||
if (!is_same_bitmap(bmp, screen))
|
||||
return -1;
|
||||
@ -363,6 +366,9 @@ int osx_mouse_show(BITMAP *bmp, int x, int y)
|
||||
*/
|
||||
void osx_mouse_hide(void)
|
||||
{
|
||||
if (!_mouse_on)
|
||||
return;
|
||||
|
||||
osx_change_cursor(osx_blank_cursor);
|
||||
|
||||
osx_using_native_cursor = FALSE;
|
||||
|
@ -258,7 +258,8 @@ void osx_event_handler()
|
||||
case NSRightMouseDown:
|
||||
/* App is regaining focus */
|
||||
if (![NSApp isActive]) {
|
||||
handle_mouse_enter();
|
||||
if ([view mouse:point inRect:[view frame]])
|
||||
handle_mouse_enter();
|
||||
|
||||
if (osx_window)
|
||||
[osx_window invalidateCursorRectsForView:view];
|
||||
@ -283,7 +284,7 @@ void osx_event_handler()
|
||||
case NSLeftMouseUp:
|
||||
case NSOtherMouseUp:
|
||||
case NSRightMouseUp:
|
||||
if ([NSApp isActive])
|
||||
if ([NSApp isActive] && [view mouse:point inRect:[view frame]])
|
||||
handle_mouse_enter();
|
||||
|
||||
if (_mouse_on) {
|
||||
@ -327,7 +328,7 @@ void osx_event_handler()
|
||||
|
||||
case NSMouseEntered:
|
||||
if ([event window] == osx_window &&
|
||||
[event trackingNumber] == osx_mouse_tracking_rect) {
|
||||
[view mouse:point inRect:[view frame]]) {
|
||||
handle_mouse_enter();
|
||||
|
||||
if (_mouse_on) {
|
||||
|
Loading…
Reference in New Issue
Block a user