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

Accessibility. Crash on text hover on Windows #3742

Closed
igordmn opened this issue Sep 29, 2023 · 0 comments · Fixed by JetBrains/compose-multiplatform-core#852
Closed

Accessibility. Crash on text hover on Windows #3742

igordmn opened this issue Sep 29, 2023 · 0 comments · Fixed by JetBrains/compose-multiplatform-core#852
Labels
bug Something isn't working desktop p:critical Critical priority regression windows

Comments

@igordmn
Copy link
Collaborator

igordmn commented Sep 29, 2023

Compose 1.5.0, OpenJDK 19

On 1.4.3 it works well

OpenJDK 19

  1. Run this example:
import androidx.compose.material.Text
import androidx.compose.ui.window.singleWindowApplication

fun main() = singleWindowApplication {
    Text("Text")
}
  1. Enable Java Access bridge, run NVDA 2023.2

  2. Hover the text.

See the crash:

Exception in thread "Thread-1" java.lang.RuntimeException: java.lang.NullPointerException
	at jdk.accessibility/com.sun.java.accessibility.internal.AccessBridge$InvocationUtils.invokeAndWait(AccessBridge.java:7278)
	at jdk.accessibility/com.sun.java.accessibility.internal.AccessBridge$InvocationUtils.invokeAndWait(AccessBridge.java:7253)
	at jdk.accessibility/com.sun.java.accessibility.internal.AccessBridge.getAccessibleTextLineLeftBoundsFromContext(AccessBridge.java:2073)
	at jdk.accessibility/com.sun.java.accessibility.internal.AccessBridge.runDLL(Native Method)
	at jdk.accessibility/com.sun.java.accessibility.internal.AccessBridge$dllRunner.run(AccessBridge.java:177)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NullPointerException
	at androidx.compose.ui.platform.ComposeAccessible$ComposeAccessibleComponent$ComposeAccessibleText.getCharacterBounds(ComposeAccessible.kt:465)
	at jdk.accessibility/com.sun.java.accessibility.internal.AccessBridge$87.call(AccessBridge.java:2081)
	at jdk.accessibility/com.sun.java.accessibility.internal.AccessBridge$87.call(AccessBridge.java:2073)
	at jdk.accessibility/com.sun.java.accessibility.internal.AccessBridge$InvocationUtils$CallableWrapper.run(AccessBridge.java:7334)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:741)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
@igordmn igordmn added bug Something isn't working windows desktop p:critical Critical priority regression labels Sep 29, 2023
@igordmn igordmn changed the title Accessiblity. Crash on text hover on WIndows Accessibility. Crash on text hover on Windows Sep 29, 2023
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Sep 29, 2023
Fixes JetBrains/compose-multiplatform#3742

The fix is cherry-picked from androidx@7a7f57c to jb-main
(it contains other fix as well)

Because we always return `false`, we [have textLayoutResult = null](https://github.com/JetBrains/compose-multiplatform-core/blob/7f72ab8719252acaafc753a9aa28d2940ea995df/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/ComposeAccessible.kt#L116)

It isn't reproducible on macOs because it doesn't call `ComposeAccessibleText.getCharacterBounds`
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Oct 3, 2023
Fix Accessibility. Crash on text hover on Windows

Fixes JetBrains/compose-multiplatform#3742

The fix is cherry-picked from
androidx@7a7f57c
to jb-main
(it contains other fix as well)

Because we always return `false`, we [have textLayoutResult =
null](https://github.com/JetBrains/compose-multiplatform-core/blob/7f72ab8719252acaafc753a9aa28d2940ea995df/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/ComposeAccessible.kt#L116)

It isn't reproducible on macOs because it doesn't call
`ComposeAccessibleText.getCharacterBounds`

# Test
1. Modified AccessibilityTest (it fails before the fix on Windows/macOs)
2. VoiceOver pronounces the hovered Text on macOs, Windows
Walingar pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Oct 5, 2023
Fix Accessibility. Crash on text hover on Windows

Fixes JetBrains/compose-multiplatform#3742

The fix is cherry-picked from
androidx@7a7f57c
to jb-main
(it contains other fix as well)

Because we always return `false`, we [have textLayoutResult =
null](https://github.com/JetBrains/compose-multiplatform-core/blob/7f72ab8719252acaafc753a9aa28d2940ea995df/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/ComposeAccessible.kt#L116)

It isn't reproducible on macOs because it doesn't call
`ComposeAccessibleText.getCharacterBounds`

# Test
1. Modified AccessibilityTest (it fails before the fix on Windows/macOs)
2. VoiceOver pronounces the hovered Text on macOs, Windows
mazunin-v-jb pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Dec 7, 2023
Fix Accessibility. Crash on text hover on Windows

Fixes JetBrains/compose-multiplatform#3742

The fix is cherry-picked from
androidx@7a7f57c
to jb-main
(it contains other fix as well)

Because we always return `false`, we [have textLayoutResult =
null](https://github.com/JetBrains/compose-multiplatform-core/blob/7f72ab8719252acaafc753a9aa28d2940ea995df/compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/ComposeAccessible.kt#L116)

It isn't reproducible on macOs because it doesn't call
`ComposeAccessibleText.getCharacterBounds`

# Test
1. Modified AccessibilityTest (it fails before the fix on Windows/macOs)
2. VoiceOver pronounces the hovered Text on macOs, Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working desktop p:critical Critical priority regression windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant