Fix open location entry when pressing '~'
Recent changes in GTK default input method makes ~ char to start as dead key, that's why filechooser stopped detecting it for the keybinding to open location entry. We also make sure '~' appears in the location entry (instead of being emtpy). Fixes #4911 for GTK3
This commit is contained in:
parent
a4f45483b1
commit
573636d84a
@ -1332,6 +1332,7 @@ should_trigger_location_entry (GtkFileChooserWidget *impl,
|
|||||||
|| event->keyval == GDK_KEY_period
|
|| event->keyval == GDK_KEY_period
|
||||||
#ifdef G_OS_UNIX
|
#ifdef G_OS_UNIX
|
||||||
|| event->keyval == GDK_KEY_asciitilde
|
|| event->keyval == GDK_KEY_asciitilde
|
||||||
|
|| event->keyval == GDK_KEY_dead_tilde
|
||||||
#endif
|
#endif
|
||||||
) && !(event->state & no_text_input_mask))
|
) && !(event->state & no_text_input_mask))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1348,6 +1349,7 @@ browse_files_key_press_event_cb (GtkWidget *widget,
|
|||||||
GdkEventKey *event,
|
GdkEventKey *event,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
|
gchar *path;
|
||||||
GtkFileChooserWidget *impl = (GtkFileChooserWidget *) data;
|
GtkFileChooserWidget *impl = (GtkFileChooserWidget *) data;
|
||||||
GtkFileChooserWidgetPrivate *priv = impl->priv;
|
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_OPEN ||
|
||||||
priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER))
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user