Fix #592: Directory widget loses focus on tab completion
authorColin Clark <colin.clark@cclark.uk>
Sun, 4 Mar 2018 12:00:19 +0000 (12:00 +0000)
committerColin Clark <colin.clark@cclark.uk>
Sun, 4 Mar 2018 12:00:19 +0000 (12:00 +0000)
https://github.com/BestImageViewer/geeqie/issues/592

The call to layout_set_path() was shifting the focus.

src/layout.c

index a609813..dab1e02 100644 (file)
@@ -234,6 +234,7 @@ static void layout_path_entry_tab_cb(const gchar *path, gpointer data)
                {
                if ((!lw->dir_fd || strcmp(lw->dir_fd->path, buf) != 0) && layout_set_path(lw, buf))
                        {
+                       gtk_widget_grab_focus(GTK_WIDGET(lw->path_entry));
                        gint pos = -1;
                        /* put the G_DIR_SEPARATOR back, if we are in tab completion for a dir and result was path change */
                        gtk_editable_insert_text(GTK_EDITABLE(lw->path_entry), G_DIR_SEPARATOR_S, -1, &pos);