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
This commit is contained in:
Carlos Garnacho 2015-07-01 15:49:33 +02:00
parent f01247d815
commit e648f2c244

View File

@ -40,6 +40,13 @@
#endif #endif
#include "meta-surface-actor.h" #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 * static MetaWindow *
get_window_for_event (MetaDisplay *display, get_window_for_event (MetaDisplay *display,
const ClutterEvent *event) const ClutterEvent *event)
@ -265,15 +272,18 @@ meta_display_handle_event (MetaDisplay *display,
if (window) if (window)
{ {
if (!clutter_event_get_event_sequence (event)) /* Events that are likely to trigger compositor gestures should
{ * be known to clutter so they can propagate along the hierarchy.
/* Swallow all non-touch events on windows that come our way. * Gesture-wise, there's two groups of events we should be getting
* Touch events that reach here aren't yet in an accepted state, * here:
* so Clutter must see them to maybe trigger gestures into * - CLUTTER_TOUCH_* with a touch sequence that's not yet accepted
* recognition. * 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 = TRUE; bypass_clutter = !IS_GESTURE_EVENT (event);
}
meta_window_handle_ungrabbed_event (window, event); meta_window_handle_ungrabbed_event (window, event);