shithub: drawterm

Download patch

ref: 797626032c7fd9f8ae7402687ad732d485764b49
parent: c66b817c0f722f91eead35fa8a5005603a95cffd
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sat Feb 5 18:52:43 EST 2022

wayland: simplify pointer axis handler

--- a/gui-wl/wl-cb.c
+++ b/gui-wl/wl-cb.c
@@ -330,16 +330,11 @@
 	if(axis == 1)
 		return; /* Horizontal scroll */
 	wl = data;
-	buttons = wl->mouse.buttons;
-	if(value < 0){
-		buttons |= 8;
-	} else {
-		buttons |= 16;
-	}
 	wl->mouse.msec = time;
 	/* p9 expects a scroll event to work like a button, a set and a release */
+	buttons = wl->mouse.buttons & ~24;
+	absmousetrack(wl->mouse.xy.x, wl->mouse.xy.y, buttons | (value > 0 ? 16 : 8), wl->mouse.msec);
 	absmousetrack(wl->mouse.xy.x, wl->mouse.xy.y, buttons, wl->mouse.msec);
-	absmousetrack(wl->mouse.xy.x, wl->mouse.xy.y, wl->mouse.buttons, wl->mouse.msec);
 }
 
 static const struct wl_pointer_listener pointer_listener = {