From 2957d007a25ff4ec8c6858a056cfd40275393695 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 1 Jul 2022 08:07:29 +0200 Subject: [PATCH] app: [Wayland] only start resize gesture on pointer down Signed-off-by: Elias Naur --- app/os_wayland.go | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/app/os_wayland.go b/app/os_wayland.go index 656f997e..68cb9b03 100644 --- a/app/os_wayland.go +++ b/app/os_wayland.go @@ -886,18 +886,6 @@ func gio_onPointerButton(data unsafe.Pointer, p *C.struct_wl_pointer, serial, t, switch wbtn { case BTN_LEFT: btn = pointer.ButtonPrimary - if _, edge := w.systemGesture(); edge != 0 { - w.resize(serial, edge) - return - } - act, ok := w.w.ActionAt(w.lastPos) - if ok && w.config.Mode == Windowed { - switch act { - case system.ActionMove: - w.move(serial) - return - } - } case BTN_RIGHT: btn = pointer.ButtonSecondary case BTN_MIDDLE: @@ -916,6 +904,20 @@ func gio_onPointerButton(data unsafe.Pointer, p *C.struct_wl_pointer, serial, t, w.pointerBtns |= btn typ = pointer.Press } + if typ == pointer.Press && btn == pointer.ButtonPrimary { + if _, edge := w.systemGesture(); edge != 0 { + w.resize(serial, edge) + return + } + act, ok := w.w.ActionAt(w.lastPos) + if ok && w.config.Mode == Windowed { + switch act { + case system.ActionMove: + w.move(serial) + return + } + } + } w.flushScroll() w.resetFling() w.w.Event(pointer.Event{