-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Upgrade compose version from 1.1.1 to 1.3.0-beta02, the TextField of my desktop application could not input any Chinese character #2493
Upgrade compose version from 1.1.1 to 1.3.0-beta02, the TextField of my desktop application could not input any Chinese character #2493
Comments
Thanks for the report! |
Reproducible in 1.2.1.
In the We still can type Chinese text, but the popup is wrongly positioned. Investigating further... |
Because of I have set the UncaughtExceptionHandler for my application and exit the application while it catched. Main.kt
} fun main() = application {
} UncaughtExceptionHandler.kt
} So there are some bugs of TextFiled while inputing Chinese charcter |
Fixes JetBrains/compose-multiplatform#2040 Fixes JetBrains/compose-multiplatform#2493 notifyFocusedRect was deprecated in https://android-review.googlesource.com/c/platform/frameworks/support/+/1959647 On Android, before deprecation this method was used to scroll to the focused text input. This functionality was extracted to the text field itself, but we had another functionality on the other platforms. On Desktop we show text input popup near text input (for some languages): JetBrains/compose-multiplatform#2040 (comment) I think that this method is the right choice to implement this functionality, but I am not completely sure. Here my thoughts about alternatives: 1. Use BringIntoViewRequester. Not sure that it is possible, because its purpose - to show the view to the user, not use the passed information to determine the text popup position 2. Get information about focused area from another source that is not related to text input. For example, we can inject FocusManager, and retrieve the focused rect from it. Probably not a good idea, because the rect of arbitrary focused node isn't the same thing as the rect of focused input area.
* PlatformTextInputService. Undeprecate notifyFocusedRect Fixes JetBrains/compose-multiplatform#2040 Fixes JetBrains/compose-multiplatform#2493 notifyFocusedRect was deprecated in https://android-review.googlesource.com/c/platform/frameworks/support/+/1959647 On Android, before deprecation this method was used to scroll to the focused text input. This functionality was extracted to the text field itself, but we had another functionality on the other platforms. On Desktop we show text input popup near text input (for some languages): JetBrains/compose-multiplatform#2040 (comment) I think that this method is the right choice to implement this functionality, but I am not completely sure. Here my thoughts about alternatives: 1. Use BringIntoViewRequester. Not sure that it is possible, because its purpose - to show the view to the user, not use the passed information to determine the text popup position 2. Get information about focused area from another source that is not related to text input. For example, we can inject FocusManager, and retrieve the focused rect from it. Probably not a good idea, because the rect of arbitrary focused node isn't the same thing as the rect of focused input area. * Keep @deprecated until we don't merget this into AOSP
Fixes JetBrains/compose-multiplatform#2040 Fixes JetBrains/compose-multiplatform#2493 notifyFocusedRect was deprecated in https://android-review.googlesource.com/c/platform/frameworks/support/+/1959647 On Android, before deprecation this method was used to scroll to the focused text input. This functionality was extracted to the text field itself, but we had another functionality on the other platforms. On Desktop we show text input popup near text input (for some languages): JetBrains/compose-multiplatform#2040 (comment) I think that this method is the right choice to implement this functionality, but I am not completely sure. Here my thoughts about alternatives: 1. Use BringIntoViewRequester. Not sure that it is possible, because its purpose - to show the view to the user, not use the passed information to determine the text popup position 2. Get information about focused area from another source that is not related to text input. For example, we can inject FocusManager, and retrieve the focused rect from it. Probably not a good idea, because the rect of arbitrary focused node isn't the same thing as the rect of focused input area. Bug: b/262648050 Change-Id: I23a0425b573a644fcc114a2b60d7bbbdaf5b04ed Test: manual on Windows (./gradlew run1 -Pandroidx.compose.multiplatformEnabled=true), with Chinese keyboard layout Relnote: `notifyFocusedRect` methods in `TextInputSession` and `TextInputService` are not deprecated again.
* PlatformTextInputService. Undeprecate notifyFocusedRect Fixes JetBrains/compose-multiplatform#2040 Fixes JetBrains/compose-multiplatform#2493 notifyFocusedRect was deprecated in https://android-review.googlesource.com/c/platform/frameworks/support/+/1959647 On Android, before deprecation this method was used to scroll to the focused text input. This functionality was extracted to the text field itself, but we had another functionality on the other platforms. On Desktop we show text input popup near text input (for some languages): JetBrains/compose-multiplatform#2040 (comment) I think that this method is the right choice to implement this functionality, but I am not completely sure. Here my thoughts about alternatives: 1. Use BringIntoViewRequester. Not sure that it is possible, because its purpose - to show the view to the user, not use the passed information to determine the text popup position 2. Get information about focused area from another source that is not related to text input. For example, we can inject FocusManager, and retrieve the focused rect from it. Probably not a good idea, because the rect of arbitrary focused node isn't the same thing as the rect of focused input area. * Keep @deprecated until we don't merget this into AOSP
* PlatformTextInputService. Undeprecate notifyFocusedRect Fixes JetBrains#2040 Fixes JetBrains#2493 notifyFocusedRect was deprecated in https://android-review.googlesource.com/c/platform/frameworks/support/+/1959647 On Android, before deprecation this method was used to scroll to the focused text input. This functionality was extracted to the text field itself, but we had another functionality on the other platforms. On Desktop we show text input popup near text input (for some languages): JetBrains#2040 (comment) I think that this method is the right choice to implement this functionality, but I am not completely sure. Here my thoughts about alternatives: 1. Use BringIntoViewRequester. Not sure that it is possible, because its purpose - to show the view to the user, not use the passed information to determine the text popup position 2. Get information about focused area from another source that is not related to text input. For example, we can inject FocusManager, and retrieve the focused rect from it. Probably not a good idea, because the rect of arbitrary focused node isn't the same thing as the rect of focused input area. * Keep @deprecated until we don't merget this into AOSP
* PlatformTextInputService. Undeprecate notifyFocusedRect Fixes JetBrains/compose-multiplatform#2040 Fixes JetBrains/compose-multiplatform#2493 notifyFocusedRect was deprecated in https://android-review.googlesource.com/c/platform/frameworks/support/+/1959647 On Android, before deprecation this method was used to scroll to the focused text input. This functionality was extracted to the text field itself, but we had another functionality on the other platforms. On Desktop we show text input popup near text input (for some languages): JetBrains/compose-multiplatform#2040 (comment) I think that this method is the right choice to implement this functionality, but I am not completely sure. Here my thoughts about alternatives: 1. Use BringIntoViewRequester. Not sure that it is possible, because its purpose - to show the view to the user, not use the passed information to determine the text popup position 2. Get information about focused area from another source that is not related to text input. For example, we can inject FocusManager, and retrieve the focused rect from it. Probably not a good idea, because the rect of arbitrary focused node isn't the same thing as the rect of focused input area. * Keep @deprecated until we don't merget this into AOSP
2022-11-23 09:21:27,186 INFO (UncaughtExceptionHandler.kt:53)- java.lang.NullPointerException: Cannot read field "x" because "rc" is null
at java.desktop/sun.awt.windows.WInputMethod$1.run(WInputMethod.java:617)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
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.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
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:743)
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)
When I press the Space and Enter key to input the Chinese character, the application crashed. It is normal when I input english character.
The text was updated successfully, but these errors were encountered: