Skip to content

Commit 3c3f62d

Browse files
joanmarieraveit65
authored andcommitted
Emit accessible-name-change signal for icons only when icons are renamed
caja_icon_canvas_item_set_property was emitting accessible-name-change signals whenever the PROP_EDITABLE_TEXT was being set for an icon. This method is called by caja_icon_container_request_update_all when the icon view is first loaded. Thus irrelevant events are being emitted (the name of each icon didn't change, as far as the user is concerned). Furthermore, this floods assistive technologies any time the user opens a folder with a large number of files. Moving the notification out of caja_icon_canvas_item_set_property and into end_renaming_mode (where ICON_TEXT_CHANGED is also emitted) solves the problem of floods of irrelevant notifications while still emitting the signal when the name actually changes.
1 parent 9f8d950 commit 3c3f62d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

libcaja-private/caja-icon-canvas-item.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ caja_icon_canvas_item_set_property (GObject *object,
379379
{
380380
gail_text_util_text_setup (details->text_util,
381381
details->editable_text);
382-
g_object_notify (G_OBJECT(accessible), "accessible-name");
383382
}
384383

385384
caja_icon_canvas_item_invalidate_label_size (item);

libcaja-private/caja-icon-container.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9078,6 +9078,7 @@ end_renaming_mode (CajaIconContainer *container, gboolean commit)
90789078
{
90799079
CajaIcon *icon;
90809080
const char *changed_text;
9081+
AtkObject *accessible_icon;
90819082

90829083
set_pending_icon_to_rename (container, NULL);
90839084

@@ -9110,6 +9111,9 @@ end_renaming_mode (CajaIconContainer *container, gboolean commit)
91109111
signals[ICON_TEXT_CHANGED], 0,
91119112
icon->data,
91129113
changed_text);
9114+
9115+
accessible_icon = atk_gobject_accessible_for_object (G_OBJECT(icon->item));
9116+
g_object_notify (G_OBJECT(accessible_icon), "accessible-name");
91139117
}
91149118
}
91159119

0 commit comments

Comments
 (0)