[A5/OSX] [A5/OSX] ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY not sent?
X-G

Simple question. No event for ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY seems to be sent when the mouse is moved out of the window while still retaining focus on the window. Switching applications with Exposé or Cmd+Tab does result in the event being sent if the mouse is inside the window when I hit the respective keys (or another window is forcefully brought to the front for some other reason), but not if the mouse is outside the window at the time -- which also means that simply clicking on another window will not result in any events.

ALLEGRO_EVENT_MOUSE_ENTER_DISPLAY and other mouse-related events work just fine, just not that particular one.

EDIT: Whoops, a little duplication in the title there.

Evert

Try the following patch:

Index: ../src/macosx/qzmouse.m
===================================================================
--- ../src/macosx/qzmouse.m	(revision 14234)
+++ ../src/macosx/qzmouse.m	(working copy)
@@ -161,7 +161,7 @@
 	    osx_mouse.warped = FALSE;
 	}
 	_al_event_source_lock(&osx_mouse.parent.es);
-	if ((within||b_change) && _al_event_source_needs_to_generate_event(&osx_mouse.parent.es))
+	if ((within||b_change || type == ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY) && _al_event_source_needs_to_generate_event(&osx_mouse.parent.es))
 	{
 		ALLEGRO_EVENT new_event;
 		ALLEGRO_MOUSE_EVENT* mouse_event = &new_event.mouse;

Peter Wang

So does it work?

Evert

Does for me.

Thread #605956. Printed from Allegro.cc