GTK accessibility fixes and improvements

43 views
Skip to first unread message

Colomban Wendling

unread,
Dec 18, 2016, 11:06:59 AM12/18/16
to scintilla...@googlegroups.com
Hi Neil,

Here are 5 patches fixing or improving various issues with accessibility
support in GTK.

> 1-GTK__Add_some_documentation_on_accessible_object_reference_ownerships.patch

Just adds some explanations on the implementation as you asked some time
ago.

> 2-GTK__Fix_accessible_object_lifetime_on_GTK___3_8.patch

Fix crash when destroying ScintillaObjects, as mentioned in
https://groups.google.com/d/msg/scintilla-interest/uFysitczmag/qjZ30KN_BwAJ

2 Geany user suffered from the crash on GTK2, and I could reproduce the
crash with GTK3 if tricking it to use the path supposed to be for 3.2 to
3.6 (but that should work with any version >= 3.2, it's just uglier than
necessary on >= 3.8).
Fixing the code as I mentioned fixes both problems, and makes better sense.

As said, this is a crasher on GTK2 at least for some people, so I think
it's very important, probably even worth a 3.7.2 (or 3.7.1.1, anything)
as you said.

Sorry for that one :(

> 3-GTK__Fix_off_by_one_error_in_accessible_attribute_runs.patch

Fix reporting attribute ranges, which were 1 character too short (ATK
expects the position *after* it ends, not the last position in that run)

> 4-GTK__Fix_reporting_deletion_length_in_the_accessible.patch

Fix mostly random length reported for deletions events. As explained in
the patch, I was trying to count characters after they were removed from
the buffer, so it obviously didn't count what was expected. Caching the
length isn't too pretty, but I can't see a better solution, and it's not
so bad.

This one might be fairly important too as it may report totally
incorrect information to the accessibility layer for deletion operations.

> 5-GTK__Ensure_styles_are_valid_when_retrieving_them_for_accessibility_purposes.patch

As ATK allows retrieving information anywhere in the buffer, style might
or might not be up to date. This lead to attribute runs and character
extents to be incorrect for many offscreen ranges as they depend on the
styling.

This one somewhat relies on EnsureStyledTo() to be optimized in the
sense of not actually syling one single byte at a time (or at least
getting more for longer ranges from the lexer). If that's not a valid
assumption, it might be worth making ScintillaGTKAccessible::StyleAt()
ask for longer runs in some cases. But well, it's a possible
performance issue only for retrieving attributes on unstyled areas, so
it might not be a big issue anyway.


Regards,
Colomban
5-GTK__Ensure_styles_are_valid_when_retrieving_them_for_accessibility_purposes.patch
4-GTK__Fix_reporting_deletion_length_in_the_accessible.patch
2-GTK__Fix_accessible_object_lifetime_on_GTK___3_8.patch
3-GTK__Fix_off_by_one_error_in_accessible_attribute_runs.patch
1-GTK__Add_some_documentation_on_accessible_object_reference_ownerships.patch

Neil Hodgson

unread,
Dec 18, 2016, 10:56:27 PM12/18/16
to scintilla...@googlegroups.com
Colomban Wendling:

> Here are 5 patches fixing or improving various issues with accessibility
> support in GTK.

Thanks for these changes.

Due to seasonal time sinks I’m unsure when these will be committed or a new version released.

> This one somewhat relies on EnsureStyledTo() to be optimized in the
> sense of not actually syling one single byte at a time (or at least
> getting more for longer ranges from the lexer).

EnsureStyledTo is low level and may not perform that well. Other code that has to do similar actions will extend the styled-to position to the line end (after the line end characters) to be better.

> If that's not a valid
> assumption, it might be worth making ScintillaGTKAccessible::StyleAt()
> ask for longer runs in some cases. But well, it's a possible
> performance issue only for retrieving attributes on unstyled areas, so
> it might not be a big issue anyway.

Unless we see problematic performance, its OK. Maybe there’ll be a few hundred calls to find the whole range of a comment but that’s unlikely to be a noticeable pause.

Neil

Colomban Wendling

unread,
Dec 20, 2016, 3:58:32 PM12/20/16
to scintilla...@googlegroups.com
Hi,

Le 19/12/2016 à 04:56, Neil Hodgson a écrit :
> Colomban Wendling:
>
>> Here are 5 patches fixing or improving various issues with
>> accessibility support in GTK.
>
> Thanks for these changes.
>
> Due to seasonal time sinks I’m unsure when these will be committed or
> a new version released.

OK. I pushed them in Geany in the meantime, which also means a little
more testing :)

>> This one somewhat relies on EnsureStyledTo() to be optimized in
>> the sense of not actually syling one single byte at a time (or at
>> least getting more for longer ranges from the lexer).
>
> EnsureStyledTo is low level and may not perform that well. Other code
> that has to do similar actions will extend the styled-to position to
> the line end (after the line end characters) to be better.

OK.

> […]
>
> Unless we see problematic performance, its OK. Maybe there’ll be a
> few hundred calls to find the whole range of a comment but that’s
> unlikely to be a noticeable pause.

Yeah agreed, and it's unlikely to be a very sensitive area either. I
might look into it if I get time, but that doesn't seem too important
for now.

Colomban

Neil Hodgson

unread,
Dec 25, 2016, 8:59:59 PM12/25/16
to scintilla...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages