From 81152e5f3811b8da3b9f8ce280245942141d8da2 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 26 Sep 2015 11:48:21 +0100 Subject: [PATCH] Add some missing GTK focus-in event handlers. Fixes a behaviour which I intended all along but apparently didn't work before on GTK: if you start PuTTY, _select_ a saved session in the list box but don't hit Load, and then just hit Open, then it will be implicitly loaded and run for you, as a special case to save you an extra button-press. This depends on noticing that the saved-sessions list box last had the focus, for which I need my widget_focus() handler to be called for basically all config widgets so that I can track what _did_ last have focus. Unfortunately, I missed a couple out. --- unix/gtkdlg.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index e48c51b5..4cf69ba3 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -2294,6 +2294,9 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs, */ g_signal_connect(G_OBJECT(w), "changed", G_CALLBACK(droplist_selchange), dp); + + g_signal_connect(G_OBJECT(w), "focus_in_event", + G_CALLBACK(widget_focus), dp); #endif } else { #if !GTK_CHECK_VERSION(2,0,0) @@ -2400,6 +2403,8 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs, uc->treeview = w; g_signal_connect(G_OBJECT(w), "row-activated", G_CALLBACK(listbox_doubleclick), dp); + g_signal_connect(G_OBJECT(w), "focus_in_event", + G_CALLBACK(widget_focus), dp); g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(listbox_selchange), dp);