Apply right to left mode after every layout build#12276
Merged
niksedk merged 1 commit intoJul 8, 2026
Conversation
The window level right to left pass runs when the window opens, but the main layout is built later (posted to the dispatcher after the view attaches), so starting the app with right to left mode enabled walked a tree that did not contain the subtitle grid or the text boxes yet: the layout came up left to right and only looked correct in sessions where the mode was toggled by hand afterwards. Switching layouts had the same effect, since the rebuilt controls start left to right. The pass is now re-applied right after the deferred startup layout build, after a layout switch, and after the undocked video layout rebuild. All three call the same helper, and the pass is idempotent (the grid mirror tracks its state, directions are recomputed from content), so repeated application is safe.
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.
Follow up to #12256 (the commit was pushed shortly after the merge, so it needs its own PR). Completes the right to left work from issue #12249.
Problem
The window level right to left pass runs when the window opens, but the main layout is built later (posted to the dispatcher after the view attaches). Starting the app with right to left mode already enabled therefore walked a tree that did not yet contain the subtitle grid or the text boxes: the layout came up left to right, and only looked correct in sessions where the mode was toggled by hand afterwards. Switching layouts (View menu) had the same effect, since the rebuilt controls start left to right.
Fix
Re-apply the right to left pass after every layout build: the deferred startup build, a layout switch, and the undocked video layout rebuild. All three call the existing helper, which is idempotent (the edit grid mirror tracks its state through its Tag, text directions are recomputed from content), so repeated application is safe. Left to right mode is unaffected; the calls are guarded by the setting.
Testing
Verified on macOS (Apple Silicon): with right to left mode persisted from the previous session, the app now starts mirrored with no toggle needed, opening an original on top keeps the arrangement, and layout switching in right to left mode keeps the mirror. The four language arrangement screenshots on #12256 were taken with this commit included.