Rename LocalWindow to LocalAwtWindow, make it public and provide it in ComposePanel#3007
Rename LocalWindow to LocalAwtWindow, make it public and provide it in ComposePanel#3007
LocalWindow to LocalAwtWindow, make it public and provide it in ComposePanel#3007Conversation
I don't need it public, but it is useful I think. |
932fef3 to
7e2ef2d
Compare
| * [ImageComposeScene]. | ||
| */ | ||
| @ExperimentalComposeUiApi | ||
| val LocalAwtWindow = compositionLocalOf<java.awt.Window?> { null } No newline at end of file |
There was a problem hiding this comment.
| val LocalAwtWindow = compositionLocalOf<java.awt.Window?> { null } | |
| val LocalAwtWindow = staticCompositionLocalOf<java.awt.Window?> { null } |
| * [ImageComposeScene]. | ||
| */ | ||
| @ExperimentalComposeUiApi | ||
| val LocalAwtWindow = staticCompositionLocalOf<java.awt.Window?> { null } No newline at end of file |
There was a problem hiding this comment.
Maybe it's better to provide a way to get Component where Compose is attached? SwingUtilities.getWindowAncestor might be called outside on the usage side
There was a problem hiding this comment.
We could do that too, but if you just have the component, you won't know about the window changing (if it's removed and added somewhere else). At least not without adding AWT listeners, at which point I think it's too much AWT knowledge that we'd be asking from the developer.
It would also raise the question: which component exactly we'd want to report as "the" component.
Rename
LocalWindowtoLocalAwtWindow, make it public and provide it inComposePanelTesting
Added unit tests.
Release Notes
Features - Desktop
LocalAwtWindow.current.