[gtk+] file chooser: Don't switch too eagerly to search mode



commit 696129d83ca2006cd3fb69ebfb7c8fafee3f839b
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 28 17:01:30 2015 -0500

    file chooser: Don't switch too eagerly to search mode
    
    If the search entry doesn't consume the key event, don't
    change to search mode. Otherwise, we interfere e.g. with
    Ctrl and Shift keys for selection.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743660

 gtk/gtkfilechooserwidget.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index bc9224e..f192ceb 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -1246,11 +1246,12 @@ gtk_file_chooser_widget_key_press_event (GtkWidget   *widget,
   GtkFileChooserWidget *impl = (GtkFileChooserWidget *) widget;
   GtkFileChooserWidgetPrivate *priv = impl->priv;
 
-  if (priv->operation_mode != OPERATION_MODE_SEARCH)
-    operation_mode_set (impl, OPERATION_MODE_SEARCH);
-
   if (gtk_search_entry_handle_event (GTK_SEARCH_ENTRY (priv->search_entry), (GdkEvent *)event))
-    return TRUE;
+    {
+      if (priv->operation_mode != OPERATION_MODE_SEARCH)
+        operation_mode_set (impl, OPERATION_MODE_SEARCH);
+      return TRUE;
+    }
 
   return FALSE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]