Signed-off-by: Peter Hutterer <[email protected]>
---
dix/events.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/dix/events.c b/dix/events.c
index efe596b..bc981a2 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2046,6 +2046,21 @@ out:
}
+/**
+ * @return TRUE if the event provided is any of core, XI or XI2 button
+ * press.
+ */
+static BOOL
+IsButtonPressEvent(xEvent *pEvents)
+{
+ int type = pEvents->u.u.type;
+
+ if (((XI2_EVENT(pEvents) && ((xGenericEvent*)pEvents)->evtype ==
XI_ButtonPress)) ||
+ type == DeviceButtonPress || type == ButtonPress)
+ return TRUE;
+ else
+ return FALSE;
+}
/**
* Deliver events to a window. At this point, we do not yet know if the event
@@ -2129,10 +2144,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin,
xEvent
* Note that since core events are delivered first, an implicit grab may
* be activated on a core grab, stopping the XI events.
*/
- if ((type == DeviceButtonPress || type == ButtonPress ||
- ((XI2_EVENT(pEvents) && ((xGenericEvent*)pEvents)->evtype ==
XI_ButtonPress)))
- && deliveries
- && (!grab))
+ if (IsButtonPressEvent(pEvents) && deliveries && (!grab))
{
GrabRec tempGrab;
OtherInputMasks *inputMasks;
--
1.7.4.4
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel