[aseprite] 112/134: Fix more problems with OS X mouse cursor
Tobias Hansen
thansen at moszumanska.debian.org
Sat Mar 14 17:10:15 UTC 2015
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 3745f563d07cdf9eccd2d67bde3fce911445370e
Author: David Capello <davidcapello at gmail.com>
Date: Mon Jan 26 09:31:10 2015 -0300
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.
---
src/allegro/src/macosx/qzmouse.m | 6 ++++++
src/allegro/src/macosx/system.m | 7 ++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/allegro/src/macosx/qzmouse.m b/src/allegro/src/macosx/qzmouse.m
index c2f5f16..3e00668 100644
--- a/src/allegro/src/macosx/qzmouse.m
+++ b/src/allegro/src/macosx/qzmouse.m
@@ -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;
diff --git a/src/allegro/src/macosx/system.m b/src/allegro/src/macosx/system.m
index d368c45..ccd3303 100644
--- a/src/allegro/src/macosx/system.m
+++ b/src/allegro/src/macosx/system.m
@@ -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) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list