Re: wxStyledTextCtrl isn't accessible with nvda screenreader (#18683)

45 views
Skip to first unread message

WangFeng Huang

unread,
Feb 2, 2024, 12:36:46 AM2/2/24
to wx-...@googlegroups.com, wxtrac, Author

The current stc sample built on the master branch should be resolved nvaccess/nvda#13976

But the above problem still exists in the 3.2.4 build. I'm not sure if the update to Scintilla solved this issue at the same time?

Also not sure if there are other accessibility issues?

Are there any plans to port this to 3.2.x?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issues/18683/1922866289@github.com>

Maarten

unread,
Feb 2, 2024, 4:54:34 PM2/2/24
to wx-...@googlegroups.com, wxtrac, Author

Scintilla can't be backported to 3.2. Because 3.2 is compatible with c++98, and Scintilla in the master branch requires c++11.

But maybe only the relevant changes can be backported. I'll try to install nvda and verify that it works in master. And then try to figure out what fixed it. One of the Scintilla updates, or something in wxWidgets.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issues/18683/1924758251@github.com>

Maarten

unread,
Feb 2, 2024, 5:45:35 PM2/2/24
to wx-...@googlegroups.com, wxtrac, Author

Seems like a bug in wxWidgets, not Scintilla. I compiled master with Scintilla 3.7.2 (the one used in 3.2 branch) and it works fine. When I run the stc sample of the 3.2 branch, the problem appears.

For reference, the problem from the linked issue:

Write some text ex. "Hello world" on the first row then press Enter
On the second row write "Hi"

Actual behavior:
In NVDA braille viewer the content with the cursor on the second row is:
" Hi llo world"

It seems in general that after the end of the row it concatenates the remaining characters from the longest row of the control.

I'll try to bisect and find out what fixed it.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issues/18683/1924838164@github.com>

WangFeng Huang

unread,
Feb 2, 2024, 10:53:54 PM2/2/24
to wx-...@googlegroups.com, wxtrac, Author

Thank you very much for your work.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issues/18683/1925048424@github.com>

Maarten

unread,
Feb 3, 2024, 9:39:44 AM2/3/24
to wx-...@googlegroups.com, wxtrac, Author

It was fixed by fcc7430 Set wxALWAYS_NATIVE_DOUBLE_BUFFER to 1 to wxMSW too.

I don't think we can just apply that to 3.2, because it assumes all other double buffering and composition changes are applied.

The relevant line in the stc code is:
https://github.com/wxWidgets/wxWidgets/blob/b97aee419af105e5c724ead2917e1b04b9abb26a/src/stc/stc.cpp#L228-L234

Where SetBufferedDraw(false); fixes it. But this causes flickering without the double buffering fixes from master.

I'm not sure how NVDA works, but it seems to do some stuff with SCI_ messages. Maybe they can disable buffered drawing with the SCI_SETBUFFEREDDRAW message for stcwindow windows?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issues/18683/1925345785@github.com>

WangFeng Huang

unread,
Feb 4, 2024, 1:02:30 AM2/4/24
to wx-...@googlegroups.com, wxtrac, Author

I don't really understand this aspect. Maybe this is indeed a temporary way?

Cc @lukaszgo1, @seanbudd, @michaelDCurran Any thoughts?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issues/18683/1925592881@github.com>

Maarten

unread,
Feb 4, 2024, 6:01:57 AM2/4/24
to wx-...@googlegroups.com, wxtrac, Author

Maybe something else to look at. Is the wxStyledTextCtrl correctly identified as Scintilla control?
Spy++ says the classname of wxStyledTextCtrl will be wxWindow with window caption stcwindow.

https://github.com/nvaccess/nvda/blob/6d97c5a8b74bc423c13a218b7575b2b7be8858e9/source/NVDAObjects/window/__init__.py#L121-L122

elif windowClassName in ("Scintilla","TScintilla"):
    from .scintilla import Scintilla as newCls


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issues/18683/1925702672@github.com>

WangFeng Huang

unread,
Mar 9, 2024, 5:34:11 AM3/9/24
to wx-...@googlegroups.com, wxtrac, Author

It was fixed by fcc7430 Set wxALWAYS_NATIVE_DOUBLE_BUFFER to 1 to wxMSW too.

I don't think we can just apply that to 3.2, because it assumes all other double buffering and composition changes are applied.

The relevant line in the stc code is:

https://github.com/wxWidgets/wxWidgets/blob/b97aee419af105e5c724ead2917e1b04b9abb26a/src/stc/stc.cpp#L228-L234

Where SetBufferedDraw(false); fixes it. But this causes flickering without the double buffering fixes from master.

I'm not sure how NVDA works, but it seems to do some stuff with SCI_ messages. Maybe they can disable buffered drawing with the SCI_SETBUFFEREDDRAW message for stcwindow windows?

I followed this article and sent a window message to the wx.StyledTextCtrl control, but it didn't work.

NVDA has a gesture that calls out the wxPython GUI inspection tool. It contains the wx.StyledTextCtrl control. StyledTextCtrl` control, which can be found in the NVDA menu -> Preferences -> Input gestures... Input gestures... Under the Tools category.

Press NVDA+ctrl+z to open the Python console after moving focus to this control.

>>> import watchdog
>>> SCI_GETBUFFEREDDRAW = 2034
>>> SCI_SETBUFFEREDDRAW = 2035
>>> nav.name
'stcwindow'
>>> nav.windowClassName
'wxWindowNR'
>>> watchdog.cancellableSendMessage(nav.windowHandle, SCI_GETBUFFEREDDRAW, 0, 0)
0
>>> watchdog.cancellableSendMessage(nav.windowHandle, SCI_SETBUFFEREDDRAW, 1, 0)
0
>>> watchdog.cancellableSendMessage(nav.windowHandle, SCI_GETBUFFEREDDRAW, 0, 0)
0
>>> watchdog.cancellableSendMessage(nav.windowHandle, SCI_SETBUFFEREDDRAW, 0, 0)
0
>>> watchdog.cancellableSendMessage(nav.windowHandle, SCI_GETBUFFEREDDRAW, 0, 0)
0


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issues/18683/1986819884@github.com>

Adriani90

unread,
Nov 5, 2025, 2:09:16 PM (4 days ago) Nov 5
to wx-...@googlegroups.com, wxtrac, Author
Adriani90 left a comment (wxWidgets/wxWidgets#18683)

@MaartenBent any updates on this from wX side? Are you saying this should be fixed on NVDA side?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issues/18683/3492889905@github.com>

Maarten

unread,
Nov 5, 2025, 6:58:42 PM (4 days ago) Nov 5
to wx-...@googlegroups.com, wxtrac, Author
MaartenBent left a comment (wxWidgets/wxWidgets#18683)

I looked at it again, and I think I figured out the problems. NVDA doesn't recognize our control as Scintilla control, so it won't send scintilla messages (SCI_...) to get text and stuff.
I can fix that by using Scintilla as window class instead of wxWindowNR.

Second problem is we don't forward the scintilla messages to the Scintilla control. This is easy to fix.
We already forward WM_IME_ messages. I have to extend this to include the SCI_ messages.

With these fixes, all the lines appear correctly in the speech viewer. I'll try to create a PR with these fixes this weekend.

The double buffering stuff was a red herring. Because it wasn't recognized as Scintilla control, it was handled as normal Edit control instead. And this doesn't seem to work nicely with our double buffering.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issues/18683/3494132265@github.com>

VZ

unread,
Nov 8, 2025, 7:25:45 PM (yesterday) Nov 8
to wx-...@googlegroups.com, wxtrac, Author

Closed #18683 as completed via #25956.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.Message ID: <wxWidgets/wxWidgets/issue/18683/issue_event/20814775802@github.com>

Reply all
Reply to author
Forward
0 new messages