Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java/swing nvda reinitializes jtextpanel when ever insertString in the styledDocument is called #11786

Closed
christopherpross opened this issue Oct 25, 2020 · 2 comments
Labels
Abandoned requested reports or updates are missing since more than 1 year, author or users are not available. component/java-access-bridge

Comments

@christopherpross
Copy link

christopherpross commented Oct 25, 2020

Hey,
i tried to write an add-on with livetext behavior for a java-application. I saw a strange behavior in the nvda-log, so I write a simple example application to reproduce that. This is reproduceable in the small application. Of curse, the misstake could be on my add-on, but I will give you the code of the add-on, if this is a bug, this should be fixed.

Steps to reproduce:

Actual behavior:

It looks like nvda reinitalizes the jtextpanel on every call on jtextpanel.getstyleddocument.insertstring()
For me the log looks like this, please ignore the braille-debug messages.

test: new object initialized, devinfo:["name: 'Simple example'", 'role: ROLE_PANE', 'roleText: None', 'states: STATE_FOCUSABLE, STATE_FOCUSED', 'isFocusable: True', 'hasFocus: True', 'Python object: <NVDAObjects.IAccessible.IAccessible object at 0x08B2A410>', "Python class mro: (<class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", 'description: None', 'location: RectLTWH(left=1226, top=750, width=428, height=244)', 'value: None', "appModule: <'java' (appName 'java', process ID 9176) at address 7391e50>", "appModule.productName: 'OpenJDK Platform 11'", "appModule.productVersion: '11.0.8'", "TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>", 'windowHandle: 920496', "windowClassName: 'SunAwtFrame'", 'windowControlID: 0', 'windowStyle: 382664704', 'extendedWindowStyle: 256', 'windowThreadID: 1728', "windowText: 'Simple example'", "displayText: ''", 'IAccessibleObject: <POINTER(IAccessible) ptr=0x7814558 at 46d2d50>', 'IAccessibleChildID: 0', 'IAccessible event parameters: windowHandle=920496, objectID=-4, childID=0', "IAccessible accName: 'Simple example'", 'IAccessible accRole: ROLE_SYSTEM_CLIENT', 'IAccessible accState: STATE_SYSTEM_FOCUSED, STATE_SYSTEM_FOCUSABLE, STATE_SYSTEM_VALID (1048580)', 'IAccessible accDescription: None', 'IAccessible accValue: None']
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_IAccessibleRole (12:26:50.967) - MainThread (20768):
accRole failed: (-2147024809, 'Falscher Parameter.', (None, None, None, 0, None))
DEBUG - _UIAHandler.UIAHandler.IUIAutomationEventHandler_HandleAutomationEvent (12:26:50.969) - Dummy-4 (9944):
HandleAutomationEvent: Ignoring event UIA_window_windowOpen for non native element
DEBUG - NVDAObjects.JAB.JAB._get_states (12:26:50.996) - MainThread (20768):
states: enabled,focusable,visible,showing,focused,opaque,editable,multiple line
DEBUG - external:appModules.java.AppModule.chooseNVDAObjectOverlayClasses (12:26:50.998) - MainThread (20768):
test: new object initialized, devinfo:["name: 'Chat Output'", 'role: ROLE_EDITABLETEXT', 'roleText: None', 'states: STATE_FOCUSABLE, STATE_EDITABLE, STATE_FOCUSED', 'isFocusable: True', 'hasFocus: True', 'Python object: <NVDAObjects.JAB.JAB object at 0x08BE5E70>', "Python class mro: (<class 'NVDAObjects.JAB.JAB'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", "description: 'text/plain'", 'location: RectLTWH(left=817, top=500, width=286, height=163)', 'value: None', "appModule: <'java' (appName 'java', process ID 9176) at address 7391e50>", "appModule.productName: 'OpenJDK Platform 11'", "appModule.productVersion: '11.0.8'", "TextInfo: <class 'NVDAObjects.JAB.JABTextInfo'>", 'windowHandle: 920496', "windowClassName: 'SunAwtFrame'", 'windowControlID: 0', 'windowStyle: 382664704', 'extendedWindowStyle: 256', 'windowThreadID: 1728', "windowText: 'Simple example'", "displayText: ''"]
DEBUG - external:appModules.java.ChatoutputBox.startMonitoring (12:26:51.000) - MainThread (20768):
test: chatbox monitoring started!
DEBUG - NVDAObjects.JAB.JAB._get_states (12:26:51.011) - MainThread (20768):
states: enabled,focusable,visible,showing,focused,opaque,editable,multiple line
DEBUG - external:appModules.java.AppModule.chooseNVDAObjectOverlayClasses (12:26:51.012) - MainThread (20768):
test: new object initialized, devinfo:["name: 'Chat Output'", 'role: ROLE_EDITABLETEXT', 'roleText: None', 'states: STATE_FOCUSABLE, STATE_EDITABLE, STATE_FOCUSED', 'isFocusable: True', 'hasFocus: True', 'Python object: <NVDAObjects.JAB.JAB object at 0x08BE5B70>', "Python class mro: (<class 'NVDAObjects.JAB.JAB'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", "description: 'text/plain'", 'location: RectLTWH(left=817, top=500, width=286, height=163)', 'value: None', "appModule: <'java' (appName 'java', process ID 9176) at address 7391e50>", "appModule.productName: 'OpenJDK Platform 11'", "appModule.productVersion: '11.0.8'", "TextInfo: <class 'NVDAObjects.JAB.JABTextInfo'>", 'windowHandle: 920496', "windowClassName: 'SunAwtFrame'", 'windowControlID: 0', 'windowStyle: 382664704', 'extendedWindowStyle: 256', 'windowThreadID: 1728', "windowText: 'Simple example'", "displayText: ''"]
DEBUG - external:appModules.java.ChatoutputBox.startMonitoring (12:26:51.012) - MainThread (20768):
test: chatbox monitoring started!
DEBUG - NVDAObjects.JAB.JAB._get_states (12:26:51.017) - MainThread (20768):
states: enabled,focusable,visible,showing,focused,opaque,editable,multiple line
DEBUG - external:appModules.java.AppModule.chooseNVDAObjectOverlayClasses (12:26:51.018) - MainThread (20768):
test: new object initialized, devinfo:["name: 'Chat Output'", 'role: ROLE_EDITABLETEXT', 'roleText: None', 'states: STATE_FOCUSABLE, STATE_EDITABLE, STATE_FOCUSED', 'isFocusable: True', 'hasFocus: True', 'Python object: <NVDAObjects.JAB.JAB object at 0x08BE51B0>', "Python class mro: (<class 'NVDAObjects.JAB.JAB'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", "description: 'text/plain'", 'location: RectLTWH(left=817, top=500, width=286, height=163)', 'value: None', "appModule: <'java' (appName 'java', process ID 9176) at address 7391e50>", "appModule.productName: 'OpenJDK Platform 11'", "appModule.productVersion: '11.0.8'", "TextInfo: <class 'NVDAObjects.JAB.JABTextInfo'>", 'windowHandle: 920496', "windowClassName: 'SunAwtFrame'", 'windowControlID: 0', 'windowStyle: 382664704', 'extendedWindowStyle: 256', 'windowThreadID: 1728', "windowText: 'Simple example'", "displayText: ''"]
DEBUG - external:appModules.java.ChatoutputBox.startMonitoring (12:26:51.018) - MainThread (20768):
test: chatbox monitoring started!
DEBUG - NVDAObjects.JAB.JAB._get_states (12:26:51.040) - MainThread (20768):
states: enabled,focusable,visible,showing,active,resizable
DEBUG - external:appModules.java.AppModule.chooseNVDAObjectOverlayClasses (12:26:51.042) - MainThread (20768):
test: new object initialized, devinfo:["name: 'Simple example'", 'role: ROLE_FRAME', 'roleText: None', 'states: STATE_FOCUSABLE', 'isFocusable: True', 'hasFocus: False', 'Python object: <NVDAObjects.JAB.JAB object at 0x08BE99F0>', "Python class mro: (<class 'NVDAObjects.JAB.JAB'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", "description: ''", 'location: RectLTWH(left=810, top=470, width=300, height=200)', "value: ''", "appModule: <'java' (appName 'java', process ID 9176) at address 7391e50>", "appModule.productName: 'OpenJDK Platform 11'", "appModule.productVersion: '11.0.8'", "TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>", 'windowHandle: 920496', "windowClassName: 'SunAwtFrame'", 'windowControlID: 0', 'windowStyle: 382664704', 'extendedWindowStyle: 256', 'windowThreadID: 1728', "windowText: 'Simple example'", "displayText: ''"]
DEBUG - NVDAObjects.JAB.JAB._get_states (12:26:51.042) - MainThread (20768):
states: enabled,focusable,visible,showing,opaque
DEBUG - external:appModules.java.AppModule.chooseNVDAObjectOverlayClasses (12:26:51.043) - MainThread (20768):
test: new object initialized, devinfo:["name: ''", 'role: ROLE_PANEL', 'roleText: None', 'states: STATE_FOCUSABLE', 'isFocusable: True', 'hasFocus: False', 'Python object: <NVDAObjects.JAB.JAB object at 0x08BE9E90>', "Python class mro: (<class 'NVDAObjects.JAB.JAB'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", "description: ''", 'location: RectLTWH(left=817, top=500, width=286, height=163)', "value: ''", "appModule: <'java' (appName 'java', process ID 9176) at address 7391e50>", "appModule.productName: 'OpenJDK Platform 11'", "appModule.productVersion: '11.0.8'", "TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>", 'windowHandle: 920496', "windowClassName: 'SunAwtFrame'", 'windowControlID: 0', 'windowStyle: 382664704', 'extendedWindowStyle: 256', 'windowThreadID: 1728', "windowText: 'Simple example'", "displayText: ''"]
DEBUG - NVDAObjects.JAB.JAB._get_states (12:26:51.043) - MainThread (20768):
states: enabled,focusable,visible,showing
DEBUG - external:appModules.java.AppModule.chooseNVDAObjectOverlayClasses (12:26:51.044) - MainThread (20768):
test: new object initialized, devinfo:["name: ''", 'role: ROLE_PANEL', 'roleText: None', 'states: STATE_FOCUSABLE', 'isFocusable: True', 'hasFocus: False', 'Python object: <NVDAObjects.JAB.JAB object at 0x08BE9770>', "Python class mro: (<class 'NVDAObjects.JAB.JAB'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", "description: ''", 'location: RectLTWH(left=817, top=500, width=286, height=163)', "value: ''", "appModule: <'java' (appName 'java', process ID 9176) at address 7391e50>", "appModule.productName: 'OpenJDK Platform 11'", "appModule.productVersion: '11.0.8'", "TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>", 'windowHandle: 920496', "windowClassName: 'SunAwtFrame'", 'windowControlID: 0', 'windowStyle: 382664704', 'extendedWindowStyle: 256', 'windowThreadID: 1728', "windowText: 'Simple example'", "displayText: ''"]
DEBUG - NVDAObjects.JAB.JAB._get_states (12:26:51.045) - MainThread (20768):
states: enabled,focusable,visible,showing,opaque
DEBUG - external:appModules.java.AppModule.chooseNVDAObjectOverlayClasses (12:26:51.046) - MainThread (20768):
test: new object initialized, devinfo:["name: ''", 'role: ROLE_PANEL', 'roleText: None', 'states: STATE_FOCUSABLE', 'isFocusable: True', 'hasFocus: False', 'Python object: <NVDAObjects.JAB.JAB object at 0x08B2A490>', "Python class mro: (<class 'NVDAObjects.JAB.JAB'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", "description: ''", 'location: RectLTWH(left=817, top=500, width=286, height=163)', "value: ''", "appModule: <'java' (appName 'java', process ID 9176) at address 7391e50>", "appModule.productName: 'OpenJDK Platform 11'", "appModule.productVersion: '11.0.8'", "TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>", 'windowHandle: 920496', "windowClassName: 'SunAwtFrame'", 'windowControlID: 0', 'windowStyle: 382664704', 'extendedWindowStyle: 256', 'windowThreadID: 1728', "windowText: 'Simple example'", "displayText: ''"]
DEBUG - NVDAObjects.NVDAObject._get_placeholder (12:26:51.048) - MainThread (20768):
Potential unimplemented child class: <NVDAObjects.Dynamic_ChatoutputBoxEditableTextWithoutAutoSelectDetectionJAB object at 0x08BE5E70>
DEBUG - JABHandler.JABContext.getAccessibleTextLineBounds (12:26:51.051) - MainThread (20768):
lineBounds: index 0
DEBUG - JABHandler.JABContext.getAccessibleTextLineBounds (12:26:51.052) - MainThread (20768):
line bounds: start -1, end -1
IO - braille.BrailleBuffer.update (12:26:51.070) - MainThread (20768):
Braille regions text: ['Chat Output ef text/plain ', ' ']
IO - braille.BrailleHandler.update (12:26:51.070) - MainThread (20768):
Braille window dots: 147 125 1 2345 - 1357 136 2345 1234 136 2345 - 15 124 - 2345 15 1346 2345 256 1234 123 1 24 1345 - -
DEBUG - hwIo.IoBase.write (12:26:51.071) - braille._BgThread (15984):
Write: b'\x81(\x00\x00I\x13\x01\x1e\x00U%\x1e\x0f%\x1e\x00\x11\x0b\x00\x1e\x11-\x1e2\x0f\x07\x01\n\x1d\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00l'
IO - braille.BrailleHandler.update (12:26:51.071) - MainThread (20768):
Braille window dots: 147 125 1 2345 - 1357 136 2345 1234 136 2345 - 15 124 - 2345 15 1346 2345 256 1234 123 1 24 1345 - -
DEBUG - hwIo.IoBase._notifyReceive (12:26:51.071) - braille._BgThread (15984):
Read: b'\x01\x00\x00\x00'
DEBUG - brailleDisplayDrivers.freedomScientific.BrailleDisplayDriver._onReceive (12:26:51.072) - braille._BgThread (15984):
Got packet of type b'\x01' with args: b'\x00' b'\x00' b'\x00'
DEBUG - hwIo.IoBase.write (12:26:51.072) - braille._BgThread (15984):
Write: b'\x81(\x00\x00I\x13\x01\x1e\x00U%\x1e\x0f%\x1e\x00\x11\x0b\x00\x1e\x11-\x1e2\x0f\x07\x01\n\x1d\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00l'
DEBUG - hwIo.IoBase._notifyReceive (12:26:51.073) - braille._BgThread (15984):
Read: b'\x01\x00\x00\x00'
DEBUG - brailleDisplayDrivers.freedomScientific.BrailleDisplayDriver._onReceive (12:26:51.073) - braille._BgThread (15984):
Got packet of type b'\x01' with args: b'\x00' b'\x00' b'\x00'
DEBUG - NVDAObjects.JAB.JAB._get_states (12:26:51.074) - MainThread (20768):
states: enabled,focusable,visible,showing,active,resizable
DEBUG - external:appModules.java.AppModule.chooseNVDAObjectOverlayClasses (12:26:51.075) - MainThread (20768):
test: new object initialized, devinfo:["name: 'Simple example'", 'role: ROLE_FRAME', 'roleText: None', 'states: STATE_FOCUSABLE', 'isFocusable: True', 'hasFocus: False', 'Python object: <NVDAObjects.JAB.JAB object at 0x08C0A110>', "Python class mro: (<class 'NVDAObjects.JAB.JAB'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", "description: ''", 'location: RectLTWH(left=810, top=470, width=300, height=200)', "value: ''", "appModule: <'java' (appName 'java', process ID 9176) at address 7391e50>", "appModule.productName: 'OpenJDK Platform 11'", "appModule.productVersion: '11.0.8'", "TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>", 'windowHandle: 920496', "windowClassName: 'SunAwtFrame'", 'windowControlID: 0', 'windowStyle: 382664704', 'extendedWindowStyle: 256', 'windowThreadID: 1728', "windowText: 'Simple example'", "displayText: ''"]

Expected behavior:

the object should be not reinitialized and the monitoring should work. Every textchange event, here, there should a log message, that there was the text changed.

System configuration

NVDA installed/portable/running from source:

installed

NVDA version:

2020.3

Windows version:

latest windows 10 public version with all updates installed

Name and version of other software in use when reproducing the issue:

I tried multible versions of java with accessbridge, including:

  • oracle java 8
  • openjdk 11
  • openjdk 14

Other information about your system:

none

Other questions

Does the issue still occur after restarting your computer?

yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

yes, tried the following versions:

  • 2020.3
  • 2020.2
  • latest master

If addons are disabled, is your problem still occuring?

I can not say that, because I can only disable all other add-ons, tried this out and yeah, problem is not solved.

Did you try to run the COM registry fixing tool in NVDA menu / tools?

yes, no improvements

@Adriani90
Copy link
Collaborator

@christopherpross, @mwhapples are you still able to reproduce this issue with NVDA 2024.3 Beta?

@Adriani90 Adriani90 added the Abandoned requested reports or updates are missing since more than 1 year, author or users are not available. label Nov 22, 2024
@Adriani90
Copy link
Collaborator

We didn't get any updates from the initial author upon request since many years. I am closing as abandoned. If you are sthill having this issue, please comment and we can reopen.

@Adriani90 Adriani90 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Abandoned requested reports or updates are missing since more than 1 year, author or users are not available. component/java-access-bridge
Projects
None yet
Development

No branches or pull requests

3 participants