Propagate LocalLayoutDirection into PopupLayout - #562
Merged
Alexander Maryanovsky (m-sasha) merged 2 commits intoMay 17, 2023
Merged
Conversation
Alexander Maryanovsky (m-sasha)
requested review from
Igor Demin (igordmn) and
Nikita Lipsky (pjBooms)
May 13, 2023 08:01
Igor Demin (igordmn)
approved these changes
May 17, 2023
Alexander Maryanovsky (m-sasha)
deleted the
m-sasha/pass-only-locallayoutdirection-to-popup
branch
May 17, 2023 09:53
Igor Demin (igordmn)
pushed a commit
that referenced
this pull request
Jun 7, 2023
# Conflicts: # compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/window/DesktopPopupTest.kt
Igor Demin (igordmn)
pushed a commit
that referenced
this pull request
Jun 23, 2023
Opted to just pass in an `EmptyCoroutineContext` to `PagingDataDiffer` instead of inlining `MainDispathcherRule`, as it's clearer to follow. The removal of `loadDispatcher` was necessary for this to pass. I didn't trace why this had to be removed, but imo it makes the tests easier to read. Test: ./gradlew test connectedCheck Bug: 270612487 This is an imported pull request from androidx#562. Resolves #562 Github-Pr-Head-Sha: 1f5051a GitOrigin-RevId: 469c543 Change-Id: Ic697668277be5ad8d7f99c244a5977127f4f96ab
Zahari Zahariev (harryzz)
pushed a commit
to harryzz/compose-multiplatform-core
that referenced
this pull request
Jul 28, 2026
Zahari Zahariev (harryzz)
pushed a commit
to harryzz/compose-multiplatform-core
that referenced
this pull request
Jul 28, 2026
Opted to just pass in an `EmptyCoroutineContext` to `PagingDataDiffer` instead of inlining `MainDispathcherRule`, as it's clearer to follow. The removal of `loadDispatcher` was necessary for this to pass. I didn't trace why this had to be removed, but imo it makes the tests easier to read. Test: ./gradlew test connectedCheck Bug: 270612487 This is an imported pull request from androidx#562. Resolves JetBrains#562 Github-Pr-Head-Sha: 1f5051a GitOrigin-RevId: 469c543 Change-Id: Ic697668277be5ad8d7f99c244a5977127f4f96ab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, we overwrite (by re-providing) a bunch of locals in
ProvideCommonCompositionLocalseven within a child owner. This, for example, resets a user-providedLocalLayoutDirectionin popups.Initially I had wanted to change
ProvideCommonCompositionLocalsto only override the locals that seem to be tied to the owner. Following a conversation with Andrey Kulikov [G], however, I decided to manually forward the localLayoutDirectionto the child owner inPopupLayout, which is how Android does this.While this solves the immediate problem with
LayoutDirection, it doesn't appear to solve it for any of the other locals overridden byProvideCommonCompositionLocals. We will need to do that when/if we discover use-cases where our overriding is undesirable.Proposed Changes
PopupLayoutforward the localLayoutDirectionto the child owner.SkiaBasedOwnerkeep the layout direction in a state variable, and when changed also propagate it to the focus owner, and root layout node.Testing
Test: Added a unit test that makes sure
LocalLayoutDirectionis propagated intoPopup.Issues Fixed
Fixes: JetBrains/compose-multiplatform#3142