diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-10-15 20:53:43 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-10-15 20:53:43 -0400 |
commit | 3c217e6954c903d8e01a5333e8acf82de6be65de (patch) | |
tree | edf70b4bec5e2d73cb8cdcdf7efb53095128147c /gtk/gtkfilechooserwidget.c | |
parent | 0731c502626d2b739281f7bb87f5cfd9d8a61ade (diff) | |
download | gtk+-3c217e6954c903d8e01a5333e8acf82de6be65de.tar.gz |
file chooser: Avoid search interruption
When the search entry is shown, the 'special' nature of
., ~ and / should not trigger the location entry, because
that interrupts the search and is likely not what the
user intended.
https://bugzilla.gnome.org/show_bug.cgi?id=756505
Diffstat (limited to 'gtk/gtkfilechooserwidget.c')
-rw-r--r-- | gtk/gtkfilechooserwidget.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 21bca96828..387f61831e 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -1278,13 +1278,16 @@ key_is_left_or_right (GdkEventKey *event) } static gboolean -should_trigger_location_entry (GtkWidget *widget, - GdkEventKey *event) +should_trigger_location_entry (GtkFileChooserWidget *impl, + GdkEventKey *event) { GdkModifierType no_text_input_mask; + if (impl->priv->operation_mode == OPERATION_MODE_SEARCH) + return FALSE; + no_text_input_mask = - gtk_widget_get_modifier_mask (widget, GDK_MODIFIER_INTENT_NO_TEXT_INPUT); + gtk_widget_get_modifier_mask (GTK_WIDGET (impl), GDK_MODIFIER_INTENT_NO_TEXT_INPUT); if ((event->keyval == GDK_KEY_slash || event->keyval == GDK_KEY_KP_Divide @@ -1310,7 +1313,7 @@ browse_files_key_press_event_cb (GtkWidget *widget, GtkFileChooserWidget *impl = (GtkFileChooserWidget *) data; GtkFileChooserWidgetPrivate *priv = impl->priv; - if (should_trigger_location_entry (widget, event) && + if (should_trigger_location_entry (impl, event) && (priv->action == GTK_FILE_CHOOSER_ACTION_OPEN || priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)) { @@ -1370,7 +1373,7 @@ gtk_file_chooser_widget_key_press_event (GtkWidget *widget, GtkFileChooserWidget *impl = (GtkFileChooserWidget *) widget; GtkFileChooserWidgetPrivate *priv = impl->priv; - if (should_trigger_location_entry (widget, event)) + if (should_trigger_location_entry (impl, event)) { if (priv->action == GTK_FILE_CHOOSER_ACTION_OPEN || priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) |