Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » [A5/OSX] [A5/OSX] ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY not sent?

This thread is locked; no one can reply to it. rss feed Print
[A5/OSX] [A5/OSX] ALLEGRO_EVENT_MOUSE_LEAVE_DISPLAY not sent?
X-G
Member #856
December 2000
avatar

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.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Evert
Member #794
November 2000
avatar

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
Member #23
April 2000

So does it work?

Evert
Member #794
November 2000
avatar

Does for me.

Go to: