Revision: 3743 http://geany.svn.sourceforge.net/geany/?rev=3743&view=rev Author: eht16 Date: 2009-04-27 20:22:47 +0000 (Mon, 27 Apr 2009)
Log Message: ----------- Fix setting focus to the editor widget after changing the selection in the symbol list.
Modified Paths: -------------- trunk/ChangeLog trunk/src/treeviews.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-04-27 19:34:03 UTC (rev 3742) +++ trunk/ChangeLog 2009-04-27 20:22:47 UTC (rev 3743) @@ -7,6 +7,9 @@ Add a recent project item after creating a new project. * tagmanager/ruby.c: Fix wrong parsing of string literals (closes #2781264). + * src/treeviews.c: + Fix setting focus to the editor widget after changing the selection + in the symbol list.
2009-04-25 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/treeviews.c =================================================================== --- trunk/src/treeviews.c 2009-04-27 19:34:03 UTC (rev 3742) +++ trunk/src/treeviews.c 2009-04-27 20:22:47 UTC (rev 3743) @@ -667,23 +667,29 @@ }
-static gboolean change_focus(gpointer data) +static gboolean change_focus_to_editor(GeanyDocument *doc, GtkWidget *focus_widget) { - GeanyDocument *doc = data; - /* idx might not be valid e.g. if user closed a tab whilst Geany is opening files */ if (DOC_VALID(doc)) { GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window)); GtkWidget *sci = GTK_WIDGET(doc->editor->sci);
- if (focusw == tv.tree_openfiles) + if (focusw == focus_widget) gtk_widget_grab_focus(sci); } return FALSE; }
+static gboolean change_focus_cb(gpointer data) +{ + change_focus_to_editor(data, tv.tree_openfiles); + + return FALSE; +} + + static void on_openfiles_tree_selection_changed(GtkTreeSelection *selection, gpointer data) { GtkTreeIter iter; @@ -699,7 +705,7 @@ gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), gtk_notebook_page_num(GTK_NOTEBOOK(main_widgets.notebook), (GtkWidget*) doc->editor->sci)); - g_idle_add((GSourceFunc) change_focus, doc); + g_idle_add((GSourceFunc) change_focus_cb, doc); } }
@@ -723,7 +729,11 @@ { GeanyDocument *doc = document_get_current();
- navqueue_goto_line(doc, doc, line); + if (doc != NULL) + { + navqueue_goto_line(doc, doc, line); + change_focus_to_editor(doc, doc->priv->tag_tree); + } } } return FALSE;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.