~eliasnaur/gio

2957d007a25ff4ec8c6858a056cfd40275393695 — Elias Naur 2 years ago cab1184
app: [Wayland] only start resize gesture on pointer down

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 14 insertions(+), 12 deletions(-)

M app/os_wayland.go
M app/os_wayland.go => app/os_wayland.go +14 -12
@@ 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{