-
Notifications
You must be signed in to change notification settings - Fork 79
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
Fix window flashing background with unspecified size #442
Fix window flashing background with unspecified size #442
Conversation
compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Dialog.desktop.kt
Outdated
Show resolved
Hide resolved
compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/AwtWindow.desktop.kt
Show resolved
Hide resolved
4a0907f
to
da58c9c
Compare
compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Dialog.desktop.kt
Show resolved
Hide resolved
compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Dialog.desktop.kt
Show resolved
Hide resolved
Please take a look at failing |
compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/util/Windows.desktop.kt
Outdated
Show resolved
Hide resolved
compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/Window.desktop.kt
Outdated
Show resolved
Hide resolved
@igordmn setSizeSafely must be called at least once, because the check is
and the initial value of |
Changes in the latest commit:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/util/Windows.desktop.kt
Show resolved
Hide resolved
63e7126
to
b98ec80
Compare
…ore the window is shown even if the window size is unspecified.
…le even when their size is Unspecified.
…d validate the size at which the Window/Dialog are drawn.
…e the way they are.
…ion determine unmaximized state` test.
b98ec80
to
ba7e155
Compare
…test on Linux and document the reason.
Proposed Changes
The original fix to the window background being visible before the context was to add this in the
update
callback toAwtWindow
:Unfortunately, if the window/dialog size is
Unspecified
,setSizeSafely
callspack()
on the window, to determine its preferred size, making is displayable, and so the code above isn't called.This PR does the following
pack()
insetSizeSafely
to avoid an inconsistent state.revalidate
instead ofpack
to force composition+layout.window.makeDisplayable()
fromAwtWindow
. Not sure why it was needed.setSizeSafely
a bit more easy to understand.Testing
Test: Added new unit tests.
Issues Fixed
Fixes: JetBrains/compose-multiplatform#1794