forked from joejulian/gio
app: [Wayland] only start resize gesture on pointer down
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+14
-12
@@ -886,18 +886,6 @@ func gio_onPointerButton(data unsafe.Pointer, p *C.struct_wl_pointer, serial, t,
|
|||||||
switch wbtn {
|
switch wbtn {
|
||||||
case BTN_LEFT:
|
case BTN_LEFT:
|
||||||
btn = pointer.ButtonPrimary
|
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:
|
case BTN_RIGHT:
|
||||||
btn = pointer.ButtonSecondary
|
btn = pointer.ButtonSecondary
|
||||||
case BTN_MIDDLE:
|
case BTN_MIDDLE:
|
||||||
@@ -916,6 +904,20 @@ func gio_onPointerButton(data unsafe.Pointer, p *C.struct_wl_pointer, serial, t,
|
|||||||
w.pointerBtns |= btn
|
w.pointerBtns |= btn
|
||||||
typ = pointer.Press
|
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.flushScroll()
|
||||||
w.resetFling()
|
w.resetFling()
|
||||||
w.w.Event(pointer.Event{
|
w.w.Event(pointer.Event{
|
||||||
|
|||||||
Reference in New Issue
Block a user