Windows: resize border from the first frame, DPI-correct window moves (#1396)

* Windows: resize border from the first frame, DPI-correct window moves (#1381)

- The egui resize zones were laid out after the start page's early return, so a launch without
  a design had no resize edges at all. They now run on every page.
- Windows: the main window's procedure answers WM_NCHITTEST with the resize edges and corners,
  Windows' own border width at the window's DPI (8 px at 100 %), so the OS shows its resize
  cursors and runs its own resize (snap included) from the first message; no egui zones there.
- Windows: WM_GETDPISCALEDSIZE returns the size winit then applies (same logical size), so the
  rect the OS suggests while the title bar is dragged onto a monitor with another scale is the
  rect the window gets.
- Zone sizes and hit test shared in titlebar.rs and unit-tested; Windows CI checks the hit test
  right after launch and a real edge drag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Windows resize smoke: find the main window by its title

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Windows resize smoke: probe the maximized window at the screen's edge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bherbruckandClaude Opus 5.5 authored and GitHub committed 2026-10-15 10:27:21 -04:00
1 parent 1744fbb262
commit 073acd295b
10 files changed
+571 -24

No files matched your search

+9 -3
View File
@@ -322,6 +322,9 @@ pub struct SolveApp {
pub autosave_minutes: f64,
/// The application bar is the window's title bar (Windows, Linux: no OS decorations).
pub custom_titlebar: bool,
/// The OS hit test already offers the resize border ([`titlebar`]; the Windows desktop app),
/// so no egui resize zones are laid out.
pub native_resize_border: bool,
/// macOS: the traffic lights sit over the application bar's left end.
pub integrated_titlebar: bool,
/// Build bodies' display meshes on the CPU even where the GPU could (safe mode). Read by
@@ -408,6 +411,7 @@ impl SolveApp {
big_operation: false,
autosave_minutes: 5.0,
custom_titlebar: false,
native_resize_border: false,
integrated_titlebar: false,
cpu_meshing: false,
frame_ms: 0.0,
@@ -1214,6 +1218,11 @@ impl SolveApp {
issue_report::CadInput::block(self, ui, &mut report_input);
self.cad_ui(ui, &mut report_input);
drop(report_input);
// After everything else, on every page (the start page too, which returns early from
// `cad_ui`): the window's edges resize it (#1381).
if self.custom_titlebar && !self.native_resize_border {
titlebar::resize_zones(ui);
}
if self.file_picker.is_none() {
issue_report::show(self, ui.ctx());
}
@@ -1279,9 +1288,6 @@ impl SolveApp {
prefs::show_reset_notice(self, ui.ctx());
context_menu::show(self, ui.ctx());
delete::show(self, ui.ctx());
if self.custom_titlebar {
titlebar::resize_zones(ui);
}
shortcut_box::show(self, ui.ctx());
prefs::show(self, ui.ctx());
toolbar_custom::window(self, ui.ctx());