[Spice-devel] [spicy PATCH 4/7 v4] spicy: Fixed reselecting in recent chooser

Christophe Fergeau cfergeau at redhat.com
Tue Jun 16 04:55:26 PDT 2015


Hey,
The patch looks good, but the commit log could be improved imo.

On Tue, Jun 16, 2015 at 11:41:54AM +0200, Lukas Venhoda wrote:
> Recent chooser didn't unselect on loosing focus.
> Selecting recent connection, then modifying the
> entries and doubleclicking on the same recent
> connection caused spicy to connect to address
> in the entry, instead of the one in recent chooser.
> 
> Recent chooser now unselects on loosing focus,
> forcing to re-select when doubleclicking the
> recent connection, which will now properly set
> the address to connect to.


"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"

An alternative fix would be to trigger
recent_selection_changed_dialog_cb() before connect_cb() on
GtkRecentChooser::item-activated


> ---
> No changes since v3
> 
> Changes since v2
>  - New patch
>  - Split from the v2 patch as requested
> ---
>  src/spicy-connect.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/src/spicy-connect.c b/src/spicy-connect.c
> index d27cce1..1b90217 100644
> --- a/src/spicy-connect.c
> +++ b/src/spicy-connect.c
> @@ -63,6 +63,13 @@ static gboolean close_cb(gpointer data)
>      return TRUE;
>  }
> 
> +static gboolean entry_focus_in_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
> +{
> +    GtkRecentChooser *recent = data;

I'd add a GTK_RECENT_CHOOSER(data) cast in order to get a runtime check
in case something bad happens.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150616/c6902759/attachment.sig>


More information about the Spice-devel mailing list