From fb4fc576bc201d5141482d8e7d2236bc435020b9 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 29 Feb 2016 22:13:23 -0300 Subject: [PATCH] Fix clicks on X11 (fix #971) --- src/allegro/src/x/xwin.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/allegro/src/x/xwin.c b/src/allegro/src/x/xwin.c index bc195dbb1..dd0aa8d89 100644 --- a/src/allegro/src/x/xwin.c +++ b/src/allegro/src/x/xwin.c @@ -2426,6 +2426,11 @@ static void _xwin_private_process_event(XEvent *event) } break; case EnterNotify: + /* Do not generate Enter/Leave notifications when + XGrabPointer/XUngrabPointer() are called + (NotifyGrab/NotifyUngrab modes). */ + if (event->xcrossing.mode != NotifyNormal) + break; /* Mouse entered window. */ _mouse_on = TRUE; mouse_savedx = event->xcrossing.x; @@ -2442,6 +2447,8 @@ static void _xwin_private_process_event(XEvent *event) (*_xwin_mouse_interrupt)(0, 0, 0, 0, mouse_buttons); break; case LeaveNotify: + if (event->xcrossing.mode != NotifyNormal) + break; _mouse_on = FALSE; if (_xwin_mouse_interrupt) (*_xwin_mouse_interrupt)(0, 0, 0, 0, mouse_buttons);