]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Add some missing GTK focus-in event handlers.
authorSimon Tatham <anakin@pobox.com>
Sat, 26 Sep 2015 10:48:21 +0000 (11:48 +0100)
committerSimon Tatham <anakin@pobox.com>
Sat, 26 Sep 2015 10:51:23 +0000 (11:51 +0100)
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

index e48c51b59e5d8fd45e79f4ed96e193f8133e9d44..4cf69ba39e6eba9d5aab2209c6ebb2edd6094036 100644 (file)
@@ -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);