diff --git a/app/os_windows.go b/app/os_windows.go index c9d98b62..cc5ca2e5 100644 --- a/app/os_windows.go +++ b/app/os_windows.go @@ -451,23 +451,18 @@ func (w *window) hitTest(x, y int) uintptr { if w.config.Mode == Fullscreen { return windows.HTCLIENT } - p := f32.Pt(float32(x), float32(y)) - if a, ok := w.w.ActionAt(p); ok && a == system.ActionMove { - return windows.HTCAPTION - } if w.config.Mode != Windowed { // Only windowed mode should allow resizing. return windows.HTCLIENT } + // 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. top := y <= w.borderSize.Y bottom := y >= w.config.Size.Y-w.borderSize.Y left := x <= w.borderSize.X right := x >= w.config.Size.X-w.borderSize.X switch { - default: - fallthrough - case !top && !bottom && !left && !right: - return windows.HTCLIENT case top && left: return windows.HTTOPLEFT case top && right: @@ -485,6 +480,11 @@ 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 + } + return windows.HTCLIENT } func (w *window) pointerButton(btn pointer.Buttons, press bool, lParam uintptr, kmods key.Modifiers) {