Commit 0dad02e9 authored by Paolo Bacchilega's avatar Paolo Bacchilega

shortcuts: apply the mod mask in a single place

parent 67b5dd46
......@@ -3730,14 +3730,12 @@ static gboolean
gth_browser_file_list_key_press_cb (GthBrowser *browser,
GdkEventKey *event)
{
guint modifiers;
gboolean activated;
modifiers = gtk_accelerator_get_default_mod_mask ();
activated = gth_window_activate_shortcut (GTH_WINDOW (browser),
GTH_SHORTCUT_CONTEXT_BROWSER,
event->keyval,
(event->state & modifiers));
event->state);
if (! activated)
activated = gth_hook_invoke_get ("gth-browser-file-list-key-press", browser, event) != NULL;
......@@ -5687,16 +5685,14 @@ gboolean
gth_browser_viewer_key_press_cb (GthBrowser *browser,
GdkEventKey *event)
{
guint modifiers;
gboolean activated;
g_return_val_if_fail (event != NULL, FALSE);
modifiers = gtk_accelerator_get_default_mod_mask ();
activated = gth_window_activate_shortcut (GTH_WINDOW (browser),
GTH_SHORTCUT_CONTEXT_VIEWER,
event->keyval,
(event->state & modifiers));
event->state);
if (! activated && gtk_widget_get_realized (browser->priv->file_list))
activated = gth_hook_invoke_get ("gth-browser-file-list-key-press", browser, event) != NULL;
......
......@@ -892,6 +892,7 @@ gth_window_activate_shortcut (GthWindow *window,
gboolean activated = FALSE;
GthShortcut *shortcut;
modifiers = modifiers & gtk_accelerator_get_default_mod_mask ();
shortcut = gth_shortcut_array_find (window->priv->shortcuts_v, context, keycode, modifiers);
if (shortcut != NULL) {
GAction *action;
......
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