[gtk/wip/carlosg/fix-search-entry: 4/5] eventcontrollerkey: Use run_controllers() API to forward key events



commit 19bf937401947a38bc63203b0958f9c2f513db12
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Feb 20 12:48:08 2019 +0100

    eventcontrollerkey: Use run_controllers() API to forward key events
    
    All 3 phases are run ATM, but just on the specific widget.

 gtk/gtkeventcontrollerkey.c | 10 ++++++++--
 1 file 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]