[nautilus/gnome-3-30] location-entry: Chain up to parent ::event handler



commit bc907c429b7ff58edefc69b386b332da00c903de
Author: Ernestas Kulik <ekulik redhat com>
Date:   Fri Nov 30 13:49:53 2018 +0000

    location-entry: Chain up to parent ::event handler
    
    Simply propagating the event if it’s not a key press causes the parent
    handler to not be invoked and things like activating entry icons will
    stop working.
    
    Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/768
    
    
    (cherry picked from commit 43df84f5c239f2837379747e7bc6233c989ece8c)

 src/nautilus-location-entry.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-location-entry.c b/src/nautilus-location-entry.c
index 0aea63c8e..e49e16cd5 100644
--- a/src/nautilus-location-entry.c
+++ b/src/nautilus-location-entry.c
@@ -609,18 +609,20 @@ static gboolean
 nautilus_location_entry_on_event (GtkWidget *widget,
                                   GdkEvent  *event)
 {
+    GtkWidgetClass *parent_widget_class;
     NautilusLocationEntry *entry;
     NautilusLocationEntryPrivate *priv;
     GtkEditable *editable;
     gboolean selected;
     guint keyval;
     GdkModifierType state;
-    GtkWidgetClass *parent_widget_class;
     gboolean handled;
 
+    parent_widget_class = GTK_WIDGET_CLASS (nautilus_location_entry_parent_class);
+
     if (gdk_event_get_event_type (event) != GDK_KEY_PRESS)
     {
-        return GDK_EVENT_PROPAGATE;
+        return parent_widget_class->event (widget, event);
     }
 
     entry = NAUTILUS_LOCATION_ENTRY (widget);
@@ -664,7 +666,6 @@ nautilus_location_entry_on_event (GtkWidget *widget,
         set_position_and_selection_to_end (editable);
     }
 
-    parent_widget_class = GTK_WIDGET_CLASS (nautilus_location_entry_parent_class);
     /* GTK+ 4 TODO: Calling the event vfunc is not enough, we need the entry
      *              to handle the key press and insert the text first.
      *


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