diff options
author | Ernestas Kulik <ernestask@gnome.org> | 2017-12-08 16:59:08 +0200 |
---|---|---|
committer | Ernestas Kulik <ernestask@gnome.org> | 2017-12-08 17:13:53 +0200 |
commit | 0f8c18520977d6ed0a7e7e1cfc9cfe6bbf42995c (patch) | |
tree | 79c701f9955fbc4876438e81eeee6fcbb2d491ca | |
parent | 4cf282086f0e63a73cbd4c1001ba208859c6d262 (diff) | |
download | nautilus-0f8c18520977d6ed0a7e7e1cfc9cfe6bbf42995c.tar.gz |
rename-file-popover: fix key event state checking
Currently, when checking if the user pressed ctrl-z, an equality check
is used on the state to determine whether the ctrl key is pressed. That
does not work, however, as there may be other modifier masks applied, be
it internal GDK values or mapping of num lock to mod2.
That is fixed by using binary AND on the state with the relevant mask.
Closes #149.
-rw-r--r-- | src/nautilus-rename-file-popover-controller.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nautilus-rename-file-popover-controller.c b/src/nautilus-rename-file-popover-controller.c index 09d5d7980..83a13d6d9 100644 --- a/src/nautilus-rename-file-popover-controller.c +++ b/src/nautilus-rename-file-popover-controller.c @@ -195,7 +195,7 @@ name_entry_on_key_pressed (GtkWidget *widget, return name_entry_on_f2_pressed (widget, self); } else if (key_event->keyval == GDK_KEY_z && - key_event->state == GDK_CONTROL_MASK) + (key_event->state & GDK_CONTROL_MASK) != 0) { return name_entry_on_undo (widget, self); } |