app: [Windows] restore double-click restore for custom title bars

Keep custom move areas mapped to HTCAPTION even when the window is
maximized so custom title bars preserve the standard Windows behavior
where double-click restores the window.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
qiannian
2026-06-14 19:54:47 +08:00
committed by Elias Naur
parent acf5635575
commit 15335a2b37
+2 -4
View File
@@ -494,10 +494,7 @@ func getModifiers() key.Modifiers {
// hitTest returns the non-client area hit by the point, needed to
// process WM_NCHITTEST.
func (w *window) hitTest(x, y int) uintptr {
if w.config.Mode != Windowed {
// Only windowed mode should allow resizing.
return windows.HTCLIENT
}
if w.config.Mode == Windowed {
// Check for resize handle before system actions; otherwise it can be impossible to
// resize a custom-decorations window when the system move area is flush with the
// edge of the window.
@@ -523,6 +520,7 @@ func (w *window) hitTest(x, y int) uintptr {
case right:
return windows.HTRIGHT
}
}
p := f32.Pt(float32(x), float32(y))
if a, ok := w.w.ActionAt(p); ok && a == system.ActionMove {
return windows.HTCAPTION