Commit a6f7e3a2 authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair

Properly handle selection changes when using keyboard navigation. We did

2008-04-27  Christian Neumair  <cneumair@gnome.org>

	* libnautilus-private/nautilus-icon-container.c
	(emit_atk_focus_tracker_notify), (set_keyboard_focus),
	(select_range), (select_one_unselect_others), (rubberband_select),
	(keyboard_move_to):
	Properly handle selection changes when using keyboard navigation. We
	did not emit a "selection-change" signal when keyboard rubberbanding
	was used, and all except one icon were deselected. Fixes #509432.
	Thanks to Paweł Paprota.

svn path=/trunk/; revision=14092
parent d3050ae8
2008-04-27 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-icon-container.c
(emit_atk_focus_tracker_notify), (set_keyboard_focus),
(select_range), (select_one_unselect_others), (rubberband_select),
(keyboard_move_to):
Properly handle selection changes when using keyboard navigation. We
did not emit a "selection-change" signal when keyboard rubberbanding
was used, and all except one icon were deselected. Fixes #509432.
Thanks to Paweł Paprota.
2008-04-24 Cosimo Cecchi <cosimoc@gnome.org>
* src/file-manager/fm-list-view.c: (key_press_callback):
......
......@@ -733,6 +733,13 @@ clear_keyboard_focus (NautilusIconContainer *container)
container->details->keyboard_focus = NULL;
}
static void inline
emit_atk_focus_tracker_notify (NautilusIcon *icon)
{
AtkObject *atk_object = eel_accessibility_for_object (icon->item);
atk_focus_tracker_notify (atk_object);
}
/* Set @icon as the icon currently selected for keyboard operations. */
static void
set_keyboard_focus (NautilusIconContainer *container,
......@@ -751,6 +758,8 @@ set_keyboard_focus (NautilusIconContainer *container,
eel_canvas_item_set (EEL_CANVAS_ITEM (container->details->keyboard_focus->item),
"highlighted_as_keyboard_focus", 1,
NULL);
emit_atk_focus_tracker_notify (icon);
}
static void
......@@ -2085,8 +2094,7 @@ select_range (NautilusIconContainer *container,
}
if (selection_changed && icon2 != NULL) {
AtkObject *atk_object = eel_accessibility_for_object (icon2->item);
atk_focus_tracker_notify (atk_object);
emit_atk_focus_tracker_notify (icon2);
}
return selection_changed;
}
......@@ -2110,8 +2118,7 @@ select_one_unselect_others (NautilusIconContainer *container,
}
if (selection_changed && icon_to_select != NULL) {
AtkObject *atk_object = eel_accessibility_for_object (icon_to_select->item);
atk_focus_tracker_notify (atk_object);
emit_atk_focus_tracker_notify (icon_to_select);
reveal_icon (container, icon_to_select);
}
return selection_changed;
......@@ -2225,9 +2232,7 @@ rubberband_select (NautilusIconContainer *container,
}
is_in = nautilus_icon_canvas_item_hit_test_rectangle (icon->item, canvas_rect);
g_assert (icon->was_selected_before_rubberband == FALSE
|| icon->was_selected_before_rubberband == TRUE);
selection_changed |= icon_set_selected
(container, icon,
is_in ^ icon->was_selected_before_rubberband);
......@@ -2977,10 +2982,9 @@ keyboard_move_to (NautilusIconContainer *container,
set_keyboard_rubberband_start (container, from);
}
select_one_unselect_others (container, icon);
set_keyboard_focus (container, icon);
if (icon && container->details->keyboard_rubberband_start && container->details->keyboard_rubberband_start != icon) {
if (icon && container->details->keyboard_rubberband_start) {
rect = get_rubberband (container->details->keyboard_rubberband_start,
icon);
rubberband_select (container, NULL, &rect);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment