Commit Graph
1 Commits
Author SHA1 Message Date
Lam Wei Lun 78134d24c6 Keep the Speed Dial anchored to the main window (#17242)
fix: keep the Speed Dial anchored to the main window

The dial is a long-lived hidden window. Its origin was computed once, at
construction (DPIAware's CenterOnParent and create_webview's), and never
again, so moving or resizing the main frame - or dragging it to another
display - left the dial at the centre of the frame's original rect. Wayland
only looked correct because the compositor places the window there.

Re-derive the origin from the parent's current screen rect on every open,
again once the window is mapped (GTK drops a position requested before the
map), and on a DPI change. The origin comes from the fixed 540x282 box
rather than the current client height, so the content-driven resize does
not move the window while the user types. On GTK, clear the dialog's
default CENTER_ON_PARENT hint so the window manager stops overriding the
computed coordinates.

The geometry is a free function, so the centring and the work-area clamp
are testable without a GUI.
2026-11-04 17:14:04 +08:00