diff options
author | Christian Neumair <cneumair@gnome.org> | 2008-06-28 11:32:18 +0000 |
---|---|---|
committer | Christian Neumair <cneumair@src.gnome.org> | 2008-06-28 11:32:18 +0000 |
commit | 5b49b797ecb2f9cca56acd5a36d98ae46910bb3e (patch) | |
tree | 82a25e58dd4f907896f0fb78c776fa004a835f1c /libnautilus-private | |
parent | 1a01bd10be4e1baee5aa72e69f20ebbd609c46e9 (diff) | |
download | nautilus-5b49b797ecb2f9cca56acd5a36d98ae46910bb3e.tar.gz |
If no icon is selected, but an icon has the keyboard focus, select it when
2008-06-28 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-icon-container.c (keyboard_move_to),
(keyboard_space):
If no icon is selected, but an icon has the keyboard focus, select it
when pressing space. Thanks to Nelson Benítez León, A. Walton and Amir
Reza Khosroshahi. Fixes #378202.
svn path=/trunk/; revision=14285
Diffstat (limited to 'libnautilus-private')
-rw-r--r-- | libnautilus-private/nautilus-icon-container.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index ce3e2013d..df3452e2e 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -3098,13 +3098,13 @@ keyboard_move_to (NautilusIconContainer *container, return; } - if ((event->state & GDK_CONTROL_MASK) != 0) { + if (event != NULL && (event->state & GDK_CONTROL_MASK) != 0) { /* Move the keyboard focus. Use Control modifier * rather than Alt to avoid Sawfish conflict. */ set_keyboard_focus (container, icon); container->details->keyboard_rubberband_start = NULL; - } else if ((event->state & GDK_SHIFT_MASK) != 0) { + } else if (event != NULL && (event->state & GDK_SHIFT_MASK) != 0) { /* Do rubberband selection */ EelDRect rect; @@ -3356,8 +3356,13 @@ keyboard_space (NautilusIconContainer *container, { NautilusIcon *icon; - /* Control-space toggles the selection state of the current icon. */ - if ((event->state & GDK_CONTROL_MASK) != 0) { + if (!has_selection (container) && + container->details->keyboard_focus != NULL) { + keyboard_move_to (container, + container->details->keyboard_focus, + NULL, NULL); + } else if ((event->state & GDK_CONTROL_MASK) != 0) { + /* Control-space toggles the selection state of the current icon. */ if (container->details->keyboard_focus != NULL) { icon_toggle_selected (container, container->details->keyboard_focus); g_signal_emit (container, signals[SELECTION_CHANGED], 0); |