Repository navigation
Open prompts and new dialogs over the main window's monitor - #3614
Merged
Merged
Conversation
A dialog window without a remembered place opened with Position::Centered, i.e. on the primary monitor, and the main window's moves were dropped, so with the app on a second monitor the save prompt on exit came up on the first one. Track the main window's position and open such dialogs, and every fixed-size prompt, centred over it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
With the app moved to a second monitor, the unsaved-changes prompt on exit (and any dialog window opened for the
first time) comes up on the primary monitor. A dialog window without a remembered place opens with
Position::Centered, which centres it on the primary monitor, and the main window'sMovedevents are dropped(
view/mod.rsonly forwards them for windows of their own), so the app does not know where it is.Fix
Movedevents reachos_window_moved, which records its position.opens centred over the main window (
centred_over_main). Palettes and dialogs with a remembered place keep it.Tests
prompt_is_centred_over_the_main_window(second monitor, scale 1.5; unknown position leaves the placementalone).
cargo test --lib: 7103 passed, 0 failed (46 ignored)Manual check
Two monitors, app moved to the second one, close with unsaved changes: the prompt opens over the app on the second
monitor.