summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoanmarie Diggs <jdiggs@igalia.com>2018-04-23 20:25:17 +0200
committerMarco Trevisan (TreviƱo) <mail@3v1n0.net>2018-07-18 01:40:32 +0200
commit8ea8427d6788ec97e6c422bf25bac2418fe1f6e1 (patch)
tree6243714646b277d66dab6e0fd2e1ef0b9ae9dc14
parent05e21190c1961a578eead6c89f193cb028bedbac (diff)
downloadnautilus-8ea8427d6788ec97e6c422bf25bac2418fe1f6e1.tar.gz
Eliminate accessible name-changed event flood during initial load
Accessible name-changed events should not be emitted during the initial load of the icon container. They should only be emitted when a user-triggered action such as renaming the file causes the change. This event is being emitted when the editable_text property is being set. During the initial load the value is null, so check for that condition and only emit the event when the original value is non-null. (cherry picked from commit 0c80a84576a143d76388499d27f0d6d8e21b54da)
-rw-r--r--src/nautilus-canvas-item.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nautilus-canvas-item.c b/src/nautilus-canvas-item.c
index 97672001f..d1c781705 100644
--- a/src/nautilus-canvas-item.c
+++ b/src/nautilus-canvas-item.c
@@ -286,6 +286,7 @@ nautilus_canvas_item_set_property (GObject *object,
NautilusCanvasItem *item;
NautilusCanvasItemDetails *details;
AtkObject *accessible;
+ gboolean is_rename;
item = NAUTILUS_CANVAS_ITEM (object);
accessible = atk_gobject_accessible_for_object (G_OBJECT (item));
@@ -301,13 +302,15 @@ nautilus_canvas_item_set_property (GObject *object,
return;
}
+ is_rename = details->editable_text != NULL;
g_free (details->editable_text);
details->editable_text = g_strdup (g_value_get_string (value));
if (details->text_util)
{
gail_text_util_text_setup (details->text_util,
details->editable_text);
- g_object_notify (G_OBJECT (accessible), "accessible-name");
+ if (is_rename)
+ g_object_notify (G_OBJECT (accessible), "accessible-name");
}
nautilus_canvas_item_invalidate_label_size (item);