From 0b16c9c95ce38d6f7c987f0ccde98bc7c3da5b6a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20St=C3=B6sel?= Date: Mon, 19 Mar 2012 18:35:39 +0100 Subject: [PATCH] Use original event to determine midori tab mod Cast from GdkEventKey* to GdkEventKey* doesn't always work out --- midori/midori-locationaction.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 8389a9b6..d7f97b24 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -422,7 +422,7 @@ midori_location_action_add_search_engines (MidoriLocationAction* action, static void midori_location_action_complete (MidoriLocationAction* action, - GdkEventButton* event, + gboolean new_tab, const gchar* uri) { if (!strcmp (uri, "about:search")) @@ -436,8 +436,7 @@ midori_location_action_complete (MidoriLocationAction* action, { midori_location_action_popdown_completion (action); gtk_entry_set_text (GTK_ENTRY (action->entry), uri); - g_signal_emit (action, signals[SUBMIT_URI], 0, uri, - MIDORI_MOD_NEW_TAB (event->state)); + g_signal_emit (action, signals[SUBMIT_URI], 0, uri, new_tab); } } @@ -457,7 +456,8 @@ midori_location_action_treeview_button_press_cb (GtkWidget* treeview, gtk_tree_model_get_iter (action->completion_model, &iter, path); gtk_tree_path_free (path); gtk_tree_model_get (action->completion_model, &iter, URI_COL, &uri, -1); - midori_location_action_complete (action, event, uri); + midori_location_action_complete (action, + MIDORI_MOD_NEW_TAB (event->state), uri); g_free (uri); return TRUE; @@ -963,7 +963,8 @@ midori_location_action_key_press_event_cb (GtkEntry* entry, gtk_tree_model_get (model, &iter, URI_COL, &uri, -1); if (is_enter) - midori_location_action_complete (location_action, (GdkEventButton*)event, uri); + midori_location_action_complete (location_action, + MIDORI_MOD_NEW_TAB (event->state), uri); else { midori_location_action_popdown_completion (location_action); -- 2.39.5