After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756397 - Duplicate (and arguably too many) accessible object:text-changed:insert events with Gtk+ 3
Duplicate (and arguably too many) accessible object:text-changed:insert event...
Status: RESOLVED OBSOLETE
Product: gedit
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-11 18:16 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2020-11-24 09:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
accessible-event listener (448 bytes, text/plain)
2015-10-11 18:16 UTC, Joanmarie Diggs (IRC: joanie)
Details
test case (96.58 KB, text/plain)
2015-10-11 18:17 UTC, Joanmarie Diggs (IRC: joanie)
Details

Description Joanmarie Diggs (IRC: joanie) 2015-10-11 18:16:41 UTC
Created attachment 313069 [details]
accessible-event listener

Steps to reproduce:
1. Launch the accessible-event listener in a terminal
2. Open the attached test case in Gedit
3. Open the attached test case in Pluma (Gedit fork using Gtk+ 2)
4. Compare the resulting accessible object:text-changed:insert events

Expected results: No duplicate events. And preferably far fewer events.

Actual results Gedit (see below): 28 events (14 events, each duplicated) breaking the document text into 8192-character chunks.

Actual results Pluma (see below): 1 event. Admittedly missing some of the initial text, but...

Impact: Given a really large document, Orca is getting flooded with accessible events that are of no interest to Orca or its users (because the text insertion is the result of merely opening the document; not the result of user action and thus something Orca should present to the user).

=====
Pluma
=====

82510 chars inserted by [application | pluma] into [text | ] (ine 1750 Line 1751 - Line 9999 Line 10000)

=====
Gedit
=====

0 chars inserted by [application | gedit] into [text | ] (-)
0 chars inserted by [application | gedit] into [text | ] (-)
8192 chars inserted by [application | gedit] into [text | ] (Line 1 Line 2 - 921 Line 922 Li)
8192 chars inserted by [application | gedit] into [text | ] (Line 1 Line 2 - 921 Line 922 Li)
8192 chars inserted by [application | gedit] into [text | ] (ne 923 Line 924 - 1748 Line 1749 L)
8192 chars inserted by [application | gedit] into [text | ] (ne 923 Line 924 - 1748 Line 1749 L)
8192 chars inserted by [application | gedit] into [text | ] (ine 1750 Line 1751 - 2567 Line 2568 Lin)
8192 chars inserted by [application | gedit] into [text | ] (ine 1750 Line 1751 - 2567 Line 2568 Lin)
8192 chars inserted by [application | gedit] into [text | ] (e 2569 Line 2570 - 3386 Line 3387 Line)
8192 chars inserted by [application | gedit] into [text | ] (e 2569 Line 2570 - 3386 Line 3387 Line)
8192 chars inserted by [application | gedit] into [text | ] (3388 Line 3389 Line - Line 4206 Line 42)
8192 chars inserted by [application | gedit] into [text | ] (3388 Line 3389 Line - Line 4206 Line 42)
8192 chars inserted by [application | gedit] into [text | ] (07 Line 4208 Line - Line 5025 Line 5026)
8192 chars inserted by [application | gedit] into [text | ] (07 Line 4208 Line - Line 5025 Line 5026)
8192 chars inserted by [application | gedit] into [text | ] (Line 5027 Line 5028 - 5844 Line 5845 L)
8192 chars inserted by [application | gedit] into [text | ] (Line 5027 Line 5028 - 5844 Line 5845 L)
8192 chars inserted by [application | gedit] into [text | ] (ine 5846 Line 5847 - 6663 Line 6664 Lin)
8192 chars inserted by [application | gedit] into [text | ] (ine 5846 Line 5847 - 6663 Line 6664 Lin)
8192 chars inserted by [application | gedit] into [text | ] (e 6665 Line 6666 - 7482 Line 7483 Line)
8192 chars inserted by [application | gedit] into [text | ] (e 6665 Line 6666 - 7482 Line 7483 Line)
8192 chars inserted by [application | gedit] into [text | ] (7484 Line 7485 Line - Line 8302 Line 83)
8192 chars inserted by [application | gedit] into [text | ] (7484 Line 7485 Line - Line 8302 Line 83)
8192 chars inserted by [application | gedit] into [text | ] (03 Line 8304 Line - Line 9121 Line 9122)
8192 chars inserted by [application | gedit] into [text | ] (03 Line 8304 Line - Line 9121 Line 9122)
8192 chars inserted by [application | gedit] into [text | ] (Line 9123 Line 9124 - 9940 Line 9941 L)
8192 chars inserted by [application | gedit] into [text | ] (Line 9123 Line 9124 - 9940 Line 9941 L)
590 chars inserted by [application | gedit] into [text | ] (ine 9942 Line 9943 - Line 9999 Line 10000)
590 chars inserted by [application | gedit] into [text | ] (ine 9942 Line 9943 - Line 9999 Line 10000)
Comment 1 Joanmarie Diggs (IRC: joanie) 2015-10-11 18:17:56 UTC
Created attachment 313070 [details]
test case
Comment 2 Sébastien Wilmet 2015-10-11 19:15:32 UTC
It's most probably because GtkSourceView 3 loads files asynchronously, chunks by chunks, to not block the user interface.
Comment 3 Joanmarie Diggs (IRC: joanie) 2015-10-11 19:31:25 UTC
If so, that would seem to rule out the "just one, please" request.

Benjamin: What do you think about not emitting accessible text-inserted signals in this particular instance?
Comment 4 Benjamin Otte (Company) 2015-10-11 19:39:20 UTC
I don't think there's anything GTK can do about it. At least not easily.
Because when the text changes GTK doesn't know why. It just know that the text changed.
Comment 5 Benjamin Otte (Company) 2015-10-11 19:42:54 UTC
Wait, are we emitting every event twice? Because *that* should indeed be fixable. But the coalescing of multiple events into one is way more difficult on the GTK level.

Gedit could probably improve that if it didn't use 8kB buffers but larger ones (like 1MB maybe?). But I have no idea why 8kB was chosen...
Comment 6 Sébastien Wilmet 2015-10-15 12:29:20 UTC
A small chunk was probably chosen to implement easily a smooth progress bar.

For the duplication, I don't know when the accessible object:text-changed:insert events are triggered, but one thing that has changed in GTK+ 3 is the emission of the notify signal for the GtkTextBuffer:text property (in addition to the ::insert-text signal).
Comment 7 Matthias Clasen 2015-10-16 02:07:58 UTC
It looks to me like testsuite/a11y/text.c verifies that we emit text_changed::insert and text_changed::delete in the expected way.

If there is something amiss, I would appreciate a patch that adds a testcase here, showing the issue.
Comment 8 Matthias Clasen 2015-10-17 01:47:31 UTC
I don't see the duplicated events with GtkTextView examples in gtk+. Neither am I seeing it with polari. Just with gedit.

Moving the back back to where it came from
Comment 9 Sébastien Wilmet 2020-11-24 09:57:03 UTC
Mass-closing of all gedit bugzilla tickets.

Special "code" to find again all those gedit bugzilla tickets that were open before the mass-closing:

2bfe1b0590a78457e1f1a6a90fb975f5878cb60064ccfe1d7db76ca0da52f0f3

By searching the above sha256sum in bugzilla, the gedit contributors can find again the tickets. We may be interested to do so when we work on a specific area of the code, to at least know the known problems and possible enhancements.

We do this mass-closing because bugzilla.gnome.org is being replaced by gitlab.gnome.org.