Commit 67728ac0 authored by Thomas Jaeger's avatar Thomas Jaeger Committed by Alexander Larsson

Filter out events that the current window didn't select for

Signed-off-by: default avatarThomas Jaeger <ThJaeger@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=588649
parent 51f2a990
......@@ -701,6 +701,55 @@ _gdk_input_common_other_event (GdkEvent *event,
return FALSE; /* wasn't one of our event types */
}
gboolean
_gdk_input_common_event_selected (GdkEvent *event,
GdkWindow *window,
GdkDevicePrivate *gdkdev)
{
GdkWindowObject *priv = (GdkWindowObject *) window;
switch (event->type) {
case GDK_BUTTON_PRESS:
return priv->extension_events & GDK_BUTTON_PRESS_MASK;
case GDK_BUTTON_RELEASE:
return priv->extension_events & GDK_BUTTON_RELEASE_MASK;
case GDK_KEY_PRESS:
return priv->extension_events & GDK_KEY_PRESS_MASK;
case GDK_KEY_RELEASE:
return priv->extension_events & GDK_KEY_RELEASE_MASK;
case GDK_MOTION_NOTIFY:
if (priv->extension_events & GDK_POINTER_MOTION_MASK)
return TRUE;
if (gdkdev->button_count && (priv->extension_events & GDK_BUTTON_MOTION_MASK))
return TRUE;
if ((gdkdev->button_state[0] & 1 << 1) && (priv->extension_events & GDK_BUTTON1_MOTION_MASK))
return TRUE;
if ((gdkdev->button_state[0] & 1 << 2) && (priv->extension_events & GDK_BUTTON2_MOTION_MASK))
return TRUE;
if ((gdkdev->button_state[0] & 1 << 3) && (priv->extension_events & GDK_BUTTON3_MOTION_MASK))
return TRUE;
return FALSE;
case GDK_PROXIMITY_IN:
return priv->extension_events & GDK_PROXIMITY_IN_MASK;
case GDK_PROXIMITY_OUT:
return priv->extension_events & GDK_PROXIMITY_OUT_MASK;
default:
return FALSE;
}
}
gboolean
_gdk_device_get_history (GdkDevice *device,
GdkWindow *window,
......
......@@ -291,7 +291,7 @@ _gdk_input_other_event (GdkEvent *event,
display->ignore_core_events)
gdk_input_check_proximity (GDK_WINDOW_DISPLAY (window));
return TRUE;
return _gdk_input_common_event_selected(event, window, gdkdev);
}
gint
......
......@@ -179,6 +179,9 @@ gint _gdk_input_common_other_event (GdkEvent *event
XEvent *xevent,
GdkWindow *window,
GdkDevicePrivate *gdkdev);
gboolean _gdk_input_common_event_selected (GdkEvent *event,
GdkWindow *window,
GdkDevicePrivate *gdkdev);
#endif /* !XINPUT_NONE */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment