summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-12-13 13:00:36 +0000
committerMatthias Clasen <mclasen@redhat.com>2022-12-13 13:00:36 +0000
commit2f6d0792f8d23a4cd3414640c95f9c90e72dca24 (patch)
tree5deced7c75fec7a0ee752f21dc10ff2169af7502 /gtk
parent3b9531d3d332aca62d63bb8a276d5152d24d4eea (diff)
parent573636d84a2b3b2196891de97a0e6df0f1b6c5d6 (diff)
downloadgtk+-2f6d0792f8d23a4cd3414640c95f9c90e72dca24.tar.gz
Merge branch 'gtk3_fix_chooser_dead_tilde_trigger_location' into 'gtk-3-24'
Fix open location entry when pressing '~' See merge request GNOME/gtk!4971
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkfilechooserwidget.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 6a29f3fcf8..0496fd2f35 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -1332,6 +1332,7 @@ should_trigger_location_entry (GtkFileChooserWidget *impl,
|| event->keyval == GDK_KEY_period
#ifdef G_OS_UNIX
|| event->keyval == GDK_KEY_asciitilde
+ || event->keyval == GDK_KEY_dead_tilde
#endif
) && !(event->state & no_text_input_mask))
return TRUE;
@@ -1348,6 +1349,7 @@ browse_files_key_press_event_cb (GtkWidget *widget,
GdkEventKey *event,
gpointer data)
{
+ gchar *path;
GtkFileChooserWidget *impl = (GtkFileChooserWidget *) data;
GtkFileChooserWidgetPrivate *priv = impl->priv;
@@ -1358,7 +1360,8 @@ browse_files_key_press_event_cb (GtkWidget *widget,
(priv->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER))
{
- location_popup_handler (impl, event->string);
+ path = event->keyval == GDK_KEY_dead_tilde ? "~" : event->string;
+ location_popup_handler (impl, path);
return TRUE;
}