]> spindle.queued.net Git - midori/commitdiff
Clicking inside the location entry closes the completion window
authorChristian Dywan <christian@twotoasts.de>
Wed, 20 Jan 2010 20:34:17 +0000 (21:34 +0100)
committerChristian Dywan <christian@twotoasts.de>
Wed, 20 Jan 2010 20:34:17 +0000 (21:34 +0100)
midori/midori-locationaction.c

index 1c9905266bdbc0a8c8916772510d7c2ad3155c64..0078ab92c6bcb8b455b6acaf73f0dcaa266ff2c5 100644 (file)
@@ -843,6 +843,21 @@ midori_location_action_changed_cb (GtkEntry*             entry,
     katze_assign (location_action->text, g_strdup (gtk_entry_get_text (entry)));
 }
 
+static gboolean
+midori_location_action_button_press_event_cb (GtkEntry*             entry,
+                                              GdkEventKey*          event,
+                                              MidoriLocationAction* action)
+{
+    if (action->popup && GTK_WIDGET_VISIBLE (action->popup))
+    {
+        midori_location_action_popdown_completion (action);
+
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
 static gboolean
 midori_location_action_key_press_event_cb (GtkEntry*    entry,
                                            GdkEventKey* event,
@@ -1434,6 +1449,8 @@ midori_location_action_connect_proxy (GtkAction* action,
         g_object_connect (child,
                       "signal::changed",
                       midori_location_action_changed_cb, action,
+                      "signal::button-press-event",
+                      midori_location_action_button_press_event_cb, action,
                       "signal::key-press-event",
                       midori_location_action_key_press_event_cb, action,
                       #if GTK_CHECK_VERSION (2, 19, 3)