[geany/geany-plugins] d13b29: TreeBrowser: pop up context menu on Shift+F10 (#523)

Vasiliy Faronov git-noreply at xxxxx
Wed Feb 15 21:37:20 UTC 2017

Branch:      refs/heads/master
Author:      Vasiliy Faronov <vfaronov at gmail.com>
Committer:   Frank Lanitz <frank at frank.uvena.de>
Date:        Wed, 15 Feb 2017 21:37:20 UTC
Commit:      d13b29593af63dc5dd84d08de1f41ff744420eeb

Log Message:
TreeBrowser: pop up context menu on Shift+F10 (#523)

GTK+ by default maps Shift+F10 to the same thing as Menu,
which is useful for laptop keyboards (that have no Menu key).
But because TreeBrowser handles keypresses on its own,
it doesn't get this functionality automatically.

Implementation is per the "Test for modifier keys correctly"
section of the GTK+ reference manual.

Modified Paths:

Modified: treebrowser/src/treebrowser.c
4 lines changed, 3 insertions(+), 1 deletions(-)
@@ -1427,6 +1427,7 @@ on_treeview_keypress(GtkWidget *widget, GdkEventKey *event)
 	GtkTreeIter		iter;
 	GtkTreeModel	*model;
 	GtkTreePath		*path;
+	GdkModifierType	modifiers = gtk_accelerator_get_default_mod_mask();
 	if (event->keyval == GDK_space)
@@ -1445,7 +1446,8 @@ on_treeview_keypress(GtkWidget *widget, GdkEventKey *event)
 		return TRUE;
-	if (event->keyval == GDK_Menu)
+	if ((event->keyval == GDK_Menu) ||
+	    (event->keyval == GDK_F10 && (event->state & modifiers) == GDK_SHIFT_MASK))
 		gchar *name = NULL, *uri = NULL;
 		GtkWidget *menu;

This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).

More information about the Plugins-Commits mailing list