summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2019-02-20 12:48:08 +0100
committerCarlos Garnacho <carlosg@gnome.org>2019-02-20 13:16:07 +0100
commit19bf937401947a38bc63203b0958f9c2f513db12 (patch)
tree0df083780ef858861ef116f66cba542c892c2564
parent9ca392b38db0a700e76f27968ba52c5da84bc795 (diff)
downloadgtk+-19bf937401947a38bc63203b0958f9c2f513db12.tar.gz
eventcontrollerkey: Use run_controllers() API to forward key events
All 3 phases are run ATM, but just on the specific widget.
-rw-r--r--gtk/gtkeventcontrollerkey.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gtk/gtkeventcontrollerkey.c b/gtk/gtkeventcontrollerkey.c
index 91254f8bbc..f1b28d999b 100644
--- a/gtk/gtkeventcontrollerkey.c
+++ b/gtk/gtkeventcontrollerkey.c
@@ -35,6 +35,7 @@
#include "gtkeventcontrollerprivate.h"
#include "gtkeventcontrollerkey.h"
#include "gtkbindings.h"
+#include "gtkenums.h"
#include <gdk/gdk.h>
@@ -342,9 +343,14 @@ gtk_event_controller_key_forward (GtkEventControllerKey *controller,
if (!gtk_widget_get_realized (widget))
gtk_widget_realize (widget);
- if (_gtk_widget_captured_event (widget, controller->current_event))
+ if (gtk_widget_run_controllers (widget, controller->current_event,
+ GTK_PHASE_CAPTURE))
return TRUE;
- if (gtk_widget_event (widget, controller->current_event))
+ if (gtk_widget_run_controllers (widget, controller->current_event,
+ GTK_PHASE_TARGET))
+ return TRUE;
+ if (gtk_widget_run_controllers (widget, controller->current_event,
+ GTK_PHASE_BUBBLE))
return TRUE;
return FALSE;