Skip to content

Open prompts and new dialogs over the main window's monitor - #3614

Merged
HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
insanedps:pr/dialog-monitor
Nov 24, 2026
Merged

HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
insanedps:pr/dialog-monitor

Conversation

@insanedps

Copy link
Copy Markdown
Contributor

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's Moved events are dropped
(view/mod.rs only forwards them for windows of their own), so the app does not know where it is.

Fix

  • The main window's Moved events reach os_window_moved, which records its position.
  • A dialog without a place of its own, and every fixed-size prompt (unsaved changes, save, recovery, file in use ...),
    opens centred over the main window (centred_over_main). Palettes and dialogs with a remembered place keep it.
  • Until the main window's position is known, nothing changes (system-centred as before).

Tests

  • New prompt_is_centred_over_the_main_window (second monitor, scale 1.5; unknown position leaves the placement
    alone).
  • 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.

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>
@HakanSeven12
HakanSeven12 merged commit a85b1a9 into HakanSeven12:main Nov 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants