diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-09-26 07:14:14 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-09-26 07:14:14 +0000 |
commit | 2ec0bd9523f4ddeef1c3550b3bc3604abea7b0e6 (patch) | |
tree | ba8827e9ef5594c79eaf479829e86e5b0ad33e06 /src/mainwindow.c | |
parent | d73e3bb581deb1e1b9645780785bc78af3796b41 (diff) |
keep previous focus when separation changed.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1911 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r-- | src/mainwindow.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c index 490bffe1..af3ed9bb 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -1403,12 +1403,16 @@ void main_window_separation_change(MainWindow *mainwin, SeparateType type) GtkWidget *folder_wid = GTK_WIDGET_PTR(mainwin->folderview); GtkWidget *summary_wid = GTK_WIDGET_PTR(mainwin->summaryview); GtkWidget *message_wid = GTK_WIDGET_PTR(mainwin->messageview); + GtkWidget *focus_widget; debug_print(_("Changing window separation type from %d to %d\n"), mainwin->type, type); if (mainwin->type == type) return; + /* keep previous focus */ + focus_widget = gtk_window_get_focus(GTK_WINDOW(mainwin->window)); + /* remove widgets from those containers */ gtk_widget_ref(folder_wid); gtk_widget_ref(summary_wid); @@ -1442,6 +1446,8 @@ void main_window_separation_change(MainWindow *mainwin, SeparateType type) gtk_widget_hide(mainwin->window); main_window_set_widgets(mainwin, type); gtk_widget_show(mainwin->window); + if (focus_widget) + gtk_widget_grab_focus(focus_widget); gtk_widget_unref(folder_wid); gtk_widget_unref(summary_wid); |