app: [Wayland] only start resize gesture on pointer down

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-07-01 08:07:29 +02:00
parent cab1184818
commit 2957d007a2
+14 -12
View File
@@ -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{