summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-04-27 17:43:59 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-04-27 17:43:59 +0000
commiteea1388cf49da97ed7669bfbae1920ea7f5e1618 (patch)
tree0ccfff822a0a04234ab1a86b66e8721cff06ddd4
parentcc4b3798e53a3efc63c14b98d3f70488801a70a1 (diff)
downloadgtk+-eea1388cf49da97ed7669bfbae1920ea7f5e1618.tar.gz
file chooser: Fix Ctrl-L
We were forwarding key events to the search entry and unconditionally considered search started afterwards. That is not correct, since things like a Ctrl key press should not trigger search. Fix this by only switching to search mode when the event was actually consumed. Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1829
-rw-r--r--gtk/gtkfilechooserwidget.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 1e0e2c6677..2e93cd334e 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -1411,12 +1411,13 @@ widget_key_press_cb (GtkEventControllerKey *controller,
}
else
{
- gtk_event_controller_key_forward (controller, priv->search_entry);
-
- if (priv->operation_mode != OPERATION_MODE_SEARCH)
- operation_mode_set (impl, OPERATION_MODE_SEARCH);
+ if (gtk_event_controller_key_forward (controller, priv->search_entry))
+ {
+ if (priv->operation_mode != OPERATION_MODE_SEARCH)
+ operation_mode_set (impl, OPERATION_MODE_SEARCH);
- handled = TRUE;
+ handled = TRUE;
+ }
}
g_object_unref (event);