Commit e648f2c2 authored by Carlos Garnacho's avatar Carlos Garnacho

events: Ensure touchpad gesture events go through clutter

They otherwise fall through paths that enable bypass_clutter, this
is necessary so they can be picked by captured-event handlers
along the actor hierarchy.

https://bugzilla.gnome.org/show_bug.cgi?id=752248
parent f01247d8
......@@ -40,6 +40,13 @@
#endif
#include "meta-surface-actor.h"
#define IS_GESTURE_EVENT(e) ((e)->type == CLUTTER_TOUCHPAD_SWIPE || \
(e)->type == CLUTTER_TOUCHPAD_PINCH || \
(e)->type == CLUTTER_TOUCH_BEGIN || \
(e)->type == CLUTTER_TOUCH_UPDATE || \
(e)->type == CLUTTER_TOUCH_END || \
(e)->type == CLUTTER_TOUCH_CANCEL)
static MetaWindow *
get_window_for_event (MetaDisplay *display,
const ClutterEvent *event)
......@@ -265,15 +272,18 @@ meta_display_handle_event (MetaDisplay *display,
if (window)
{
if (!clutter_event_get_event_sequence (event))
{
/* Swallow all non-touch events on windows that come our way.
* Touch events that reach here aren't yet in an accepted state,
* so Clutter must see them to maybe trigger gestures into
* recognition.
*/
bypass_clutter = TRUE;
}
/* Events that are likely to trigger compositor gestures should
* be known to clutter so they can propagate along the hierarchy.
* Gesture-wise, there's two groups of events we should be getting
* here:
* - CLUTTER_TOUCH_* with a touch sequence that's not yet accepted
* by the gesture tracker, these might trigger gesture actions
* into recognition. Already accepted touch sequences are handled
* directly by meta_gesture_tracker_handle_event().
* - CLUTTER_TOUCHPAD_* events over windows. These can likewise
* trigger ::captured-event handlers along the way.
*/
bypass_clutter = !IS_GESTURE_EVENT (event);
meta_window_handle_ungrabbed_event (window, event);
......
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