From e7c711e3ee1261f4a8b3b5b40aadfb1aac97385a Mon Sep 17 00:00:00 2001 From: Boris Astardzhiev Date: Mon, 17 Feb 2020 12:34:12 +0200 Subject: [PATCH] Ignore modifier key events in type-ahead find icons feature as noted by Theo Linkspfeifer (Bug #11149) --- src/xfdesktop-icon-view.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c index cf1fab1f..2f4ce578 100644 --- a/src/xfdesktop-icon-view.c +++ b/src/xfdesktop-icon-view.c @@ -1137,12 +1137,18 @@ xfdesktop_icon_view_key_press(GtkWidget *widget, * so we have to activate the bindings manually */ ret = gtk_bindings_activate_event(G_OBJECT(icon_view), evt); if(ret == FALSE) { - /* Binding not found, now inspect the pressed character. - * Let's try to find an icon starting with this character and make - * the icon selected. */ - guint32 unicode = gdk_keyval_to_unicode(evt->keyval); - if(unicode && g_unichar_isgraph(unicode) == TRUE) - xfdesktop_icon_view_type_ahead_find_icon(icon_view, evt); + guint ignore_modifiers; + + ignore_modifiers = GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_SUPER_MASK | + GDK_HYPER_MASK | GDK_META_MASK; + if((evt->state & ignore_modifiers) == 0) { + /* Binding not found and key press is not part of a combo. + * Now inspect the pressed character. Let's try to find an + * icon starting with this character and make the icon selected. */ + guint32 unicode = gdk_keyval_to_unicode(evt->keyval); + if(unicode && g_unichar_isgraph(unicode) == TRUE) + xfdesktop_icon_view_type_ahead_find_icon(icon_view, evt); + } } return ret; -- 2.20.1