window: Reset on unhandled gestures right away

Traditionally a sequence is set to GTK_EVENT_SEQUENCE_DENIED state when
it is to be ignored, which means it is dormant, but still managed by the
gesture (accounting, "denied" sequences still make "slots" in multitouch
gesture busy, etc...).

This gesture will run for all button presses and releases in the window
though when presses happen on the "window content" region, and we can't
account for every children to be as educated as setting the proper mask
on every window, or ensuring events will be propagated as they should.

In order to cater for this, just reset the gestures, we can live without
such accounting in these specific GtkGestureSingle gestures.

https://bugzilla.gnome.org/show_bug.cgi?id=754098
This commit is contained in:
Carlos Garnacho 2015-09-17 23:22:39 +02:00
parent 15d043c5d2
commit e3bd895667

View File

@ -61,6 +61,7 @@
#include "a11y/gtkwindowaccessible.h"
#include "a11y/gtkcontaineraccessibleprivate.h"
#include "gtkapplicationprivate.h"
#include "gtkgestureprivate.h"
#include "inspector/init.h"
#include "inspector/window.h"
@ -1450,6 +1451,14 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
{
gtk_gesture_set_sequence_state (GTK_GESTURE (gesture),
sequence, GTK_EVENT_SEQUENCE_DENIED);
/* Reset immediately the gestures, here we don't get many guarantees
* about whether the target window event mask will be complete enough
* to keep gestures consistent, or whether any widget across the
* hierarchy will be inconsistent about event handler return values.
*/
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture));
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (priv->drag_gesture));
return;
}
/* fall thru */