From caf699f484d466a12f1829671d80dbabad297826 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 6 Aug 2012 15:44:26 -0400 Subject: Only hide when switching switching tabs We need to hide t->cmd, t->oops, and t->buffers when creating a new tab, because when the tab is switched to, they are automatically hidden in the notebook callback. Removing this also prevents focusing the url GtkEntry when using middle click to create a new tab, since t->focus_wv would not have been set to 1 yet in the create_new_tab() function. --- xombrero.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xombrero.c b/xombrero.c index 6b40e49..f8b3df9 100644 --- a/xombrero.c +++ b/xombrero.c @@ -7837,10 +7837,7 @@ create_new_tab(char *title, struct undo *u, int focus, int position) } else webkit_web_back_forward_list_clear(t->bfl); - /* hide stuff */ - hide_cmd(t); - hide_oops(t); - hide_buffers(t); + /* check and show url and statusbar */ url_set_visibility(); statusbar_set_visibility(); @@ -7891,7 +7888,12 @@ notebook_switchpage_cb(GtkNotebook *nb, GtkWidget *nbp, guint pn, hide_cmd(t); hide_oops(t); + hide_buffers(t); + if (t->focus_wv) { + /* can't use focus_webview here */ + gtk_widget_grab_focus(GTK_WIDGET(t->wv)); + } update_statusbar_tabs(t); break; } -- cgit 1.4.1-2-gfad0