[geany/geany] 8171af: Don't set the focus to the editor widget when clicking a symbol while holding Control
Enrico Tröger
git-noreply at xxxxx
Sun Sep 9 14:05:58 UTC 2012
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger at uvena.de>
Committer: Enrico Tröger <enrico.troeger at uvena.de>
Date: Sun, 09 Sep 2012 14:05:58
Commit: 8171af611fefe24561fee70cfe5785afd649c595
https://github.com/geany/geany/commit/8171af611fefe24561fee70cfe5785afd649c595
Log Message:
-----------
Don't set the focus to the editor widget when clicking a symbol while holding Control
When clicking a symbol in the Symbols sidebar and holding the Control modifier key, don't
set the focus to the editor widget so further navigation in the Symbols sidebar with keys
is possible.
Modified Paths:
--------------
src/sidebar.c
Modified: src/sidebar.c
17 files changed, 11 insertions(+), 6 deletions(-)
===================================================================
@@ -877,11 +877,12 @@ static gboolean openfiles_go_to_selection(GtkTreeSelection *selection, guint key
}
-static gboolean taglist_go_to_selection(GtkTreeSelection *selection, guint keyval)
+static gboolean taglist_go_to_selection(GtkTreeSelection *selection, guint keyval, guint state)
{
GtkTreeIter iter;
GtkTreeModel *model;
gint line = 0;
+ gboolean handled = TRUE;
if (gtk_tree_selection_get_selected(selection, &model, &iter))
{
@@ -899,13 +900,15 @@ static gboolean taglist_go_to_selection(GtkTreeSelection *selection, guint keyva
if (doc != NULL)
{
navqueue_goto_line(doc, doc, line);
- if (keyval != GDK_space)
+ if (keyval != GDK_space && ! (state & GDK_CONTROL_MASK))
change_focus_to_editor(doc, NULL);
+ else
+ handled = FALSE;
}
}
tm_tag_unref(tag);
}
- return FALSE;
+ return handled;
}
@@ -928,7 +931,7 @@ static gboolean sidebar_key_press_cb(GtkWidget *widget, GdkEventKey *event,
if (widget == tv.tree_openfiles) /* tag and doc list have separate handlers */
openfiles_go_to_selection(selection, event->keyval);
else
- taglist_go_to_selection(selection, event->keyval);
+ taglist_go_to_selection(selection, event->keyval, event->state);
return TRUE;
}
@@ -976,10 +979,12 @@ static gboolean sidebar_button_press_cb(GtkWidget *widget, GdkEventButton *event
else if (event->button == 1)
{ /* allow reclicking of taglist treeview item */
if (widget == tv.tree_openfiles)
+ {
openfiles_go_to_selection(selection, 0);
+ handled = TRUE;
+ }
else
- taglist_go_to_selection(selection, 0);
- handled = TRUE;
+ handled = taglist_go_to_selection(selection, 0, event->state);
}
else if (event->button == 3)
{
@@ Diff output truncated at 100000 characters. @@
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
More information about the Commits
mailing list