summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Westman <james@jwestman.net>2021-02-11 14:12:09 -0600
committerAntónio Fernandes <antoniof@gnome.org>2021-02-12 23:45:42 +0000
commitede38fd1a4b5d66733e078a301e9b94e9ceec743 (patch)
tree04d4468bff479233f1777439133f1f4c21f7fad9
parentbaf37c3102d551a7a2e7e15fbb11ba2de519d2ee (diff)
downloadnautilus-ede38fd1a4b5d66733e078a301e9b94e9ceec743.tar.gz
location-entry: Play bell when tab-complete fails
When you press Tab in the location entry and there's no autocomplete suggestion, play an error bell instead of closing the location entry. Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1171
-rw-r--r--src/nautilus-location-entry.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/nautilus-location-entry.c b/src/nautilus-location-entry.c
index f47c32c97..e204d5bc5 100644
--- a/src/nautilus-location-entry.c
+++ b/src/nautilus-location-entry.c
@@ -649,12 +649,19 @@ nautilus_location_entry_on_event (GtkWidget *widget,
* should position the insertion point at the end of
* the selection.
*/
- if (keyval == GDK_KEY_Tab && selected)
+ if (keyval == GDK_KEY_Tab && !(state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)))
{
- int position;
+ if (selected)
+ {
+ int position;
- position = strlen (gtk_entry_get_text (GTK_ENTRY (editable)));
- gtk_editable_select_region (editable, position, position);
+ position = strlen (gtk_entry_get_text (GTK_ENTRY (editable)));
+ gtk_editable_select_region (editable, position, position);
+ }
+ else
+ {
+ gtk_widget_error_bell (GTK_WIDGET (entry));
+ }
return GDK_EVENT_STOP;
}