Verified Commit 855f6805 authored by Iain Lane's avatar Iain Lane

fr-window: Show the right click menu on the "Menu" key too

This copies code from gtkplacessidebar.c in GTK. Here we also start
using `gtk_accelerator_get_default_mod_mask()`, so that we work with
exactly the keys requested and not extra ones (e.g. `Shift-F10` works
but `Ctrl-Shift-F10` now does not).
parent 0c7b2692
......@@ -4813,6 +4813,7 @@ key_press_cb (GtkWidget *widget,
FrWindow *window = data;
gboolean retval = GDK_EVENT_PROPAGATE;
gboolean alt;
guint modifiers;
if (gtk_widget_has_focus (window->priv->location_entry))
......@@ -4820,7 +4821,9 @@ key_press_cb (GtkWidget *widget,
if (gtk_widget_has_focus (window->priv->filter_entry))
alt = (event->state & GDK_MOD1_MASK) == GDK_MOD1_MASK;
modifiers = gtk_accelerator_get_default_mod_mask ();
alt = (event->state & modifiers) == GDK_MOD1_MASK;
switch (event->keyval) {
case GDK_KEY_Escape:
......@@ -4831,7 +4834,10 @@ key_press_cb (GtkWidget *widget,
case GDK_KEY_F10:
if (event->state & GDK_SHIFT_MASK) {
case GDK_KEY_Menu:
if ((event->keyval == GDK_KEY_Menu) ||
((event->keyval == GDK_KEY_F10) &&
(event->state & modifiers) == GDK_SHIFT_MASK)) {
GtkTreeSelection *selection;
GList *selected_rows;
GtkTreePath *first_selected_row_path;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment