aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--lib/widgets/ephy-location-entry.c29
2 files changed, 36 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ab1529af..9175b4cb2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-09-13 Jean-François Rameau <jframeau@cvs.gnome.org>
+
+ * lib/widgets/ephy-location-entry.c: (ephy_location_entry_construct_contents),
+ (icon_button_press_event_cb):
+
+ Clicking favicon in the location bar selects URL. Fix bug #349557.
+
2006-09-12 Christian Persch <chpe@cvs.gnome.org>
* m4/gecko.m4:
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 6ccf8453b..963e4938d 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -832,6 +832,33 @@ favicon_drag_data_get_cb (GtkWidget *widget,
}
static gboolean
+icon_button_press_event_cb (GtkWidget *ebox,
+ GdkEventButton *event,
+ EphyLocationEntry *entry)
+{
+ guint state = event->state & gtk_accelerator_get_default_mod_mask ();
+
+ if (event->type == GDK_BUTTON_PRESS &&
+ event->button == 1 &&
+ state == 0 /* left */)
+ {
+ GtkWidget *toplevel;
+ EphyLocationEntryPrivate *priv = entry->priv;
+
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (entry));
+ gtk_window_set_focus (GTK_WINDOW(toplevel),
+ priv->icon_entry->entry);
+
+ gtk_editable_select_region (GTK_EDITABLE (priv->icon_entry->entry),
+ 0, -1);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static gboolean
lock_button_press_event_cb (GtkWidget *ebox,
GdkEventButton *event,
EphyLocationEntry *entry)
@@ -871,6 +898,8 @@ ephy_location_entry_construct_contents (EphyLocationEntry *entry)
gtk_drag_source_set (priv->icon_ebox, GDK_BUTTON1_MASK,
url_drag_types, G_N_ELEMENTS (url_drag_types),
GDK_ACTION_ASK | GDK_ACTION_COPY | GDK_ACTION_LINK);
+ g_signal_connect (priv->icon_ebox, "button-press-event",
+ G_CALLBACK (icon_button_press_event_cb), entry);
gtk_tooltips_set_tip (priv->tips, priv->icon_ebox,
_("Drag and drop this icon to create a link to this page"), NULL);