Only focus the current document after switching pages if the open

files treeview currently has focus (otherwise focus commands can be
overridden, e.g. when pressing F4 during opening several files).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1843 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2007-08-30 14:24:26 +00:00
parent 641ca8e516
commit 04802a6a8c
2 changed files with 8 additions and 2 deletions

View File

@ -9,6 +9,10 @@
Rename non-menu keybinding titles, e.g. Tags menu -> Tags commands.
* src/keybindings.c:
Fix Ctrl-Shift bindings not working when caps lock is on.
* src/treeviews.c:
Only focus the current document after switching pages if the open
files treeview currently has focus (otherwise focus commands can be
overridden, e.g. when pressing F4 during opening several files).
2007-08-29 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>

View File

@ -469,9 +469,11 @@ static gboolean change_focus(gpointer data)
// idx might not be valid e.g. if user closed a tab whilst Geany is opening files
if (DOC_IDX_VALID(idx))
{
GtkWidget *widget = GTK_WIDGET(doc_list[idx].sci);
GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(app->window));
GtkWidget *sci = GTK_WIDGET(doc_list[idx].sci);
gtk_widget_grab_focus(widget);
if (focusw == tv.tree_openfiles)
gtk_widget_grab_focus(sci);
}
return FALSE;
}