diff options
author | Lukas Venhoda <lvenhoda@redhat.com> | 2015-06-16 16:23:31 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2015-06-18 17:06:42 +0200 |
commit | 07cfbe929acbf3fe233f1d642e4ee1b57e920dd3 (patch) | |
tree | 4d50a8447520ebdbbb8b4913accc0b3e6917c6b2 | |
parent | 4f7605a35f1ba99a8d10a42873f5d1515043a7c2 (diff) |
spicy: Fixed reselecting in recent chooser
Selecting an entry in the recent connections list, and then modifying
the host/port/TLS port, and double-clicking on that same entry in the
list would cause spicy to connect to the edited address rather than
the one which was picked in the recent chooser.
After this commit, the selection will be cleared from the recent
chooser, and double-clicking on an entry after editing it will always
trigger a 'selection-changed' signal, which will properly set the
address to connect to.
-rw-r--r-- | src/spicy-connect.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/spicy-connect.c b/src/spicy-connect.c index 5305840..a23ff03 100644 --- a/src/spicy-connect.c +++ b/src/spicy-connect.c @@ -60,6 +60,13 @@ static gboolean close_cb(gpointer data) return TRUE; } +static gboolean entry_focus_in_cb(GtkWidget *widget, GdkEvent *event, gpointer data) +{ + GtkRecentChooser *recent = GTK_RECENT_CHOOSER(data); + gtk_recent_chooser_unselect_all(recent); + return TRUE; +} + static gboolean key_pressed_cb(GtkWidget *widget, GdkEvent *event, gpointer data) { gboolean tst; @@ -213,6 +220,10 @@ gboolean spicy_connect_dialog(SpiceSession *session) for (i = 0; i < SPICE_N_ELEMENTS(connect_entries); i++) { g_signal_connect_swapped(connect_entries[i].entry, "activate", G_CALLBACK(connect_cb), &info); +#ifndef G_OS_WIN32 + g_signal_connect(connect_entries[i].entry, "focus-in-event", + G_CALLBACK(entry_focus_in_cb), recent); +#endif } /* show and wait for response */ |