shithub: drawterm

Download patch

ref: cddb3108d69921fc255ce72dba3689d438e53521
parent: 669c593fe8a9b4baa76e70d834a4187ae45f9499
author: Jacob Moody <moody@posixcafe.org>
date: Tue Jun 27 10:28:37 EDT 2023

gui-wl: fix client side decoration mouse events

A logic error was causing dropped mouse input events.
The intention was to allow a 'hit' from the csd mouse
handler to consume the event.

--- a/gui-wl/wl-cb.c
+++ b/gui-wl/wl-cb.c
@@ -377,9 +377,6 @@
 static int
 csd_handle_mouse(Wlwin *wl, uint32_t button, uint32_t serial)
 {
-	if(!wl->client_side_deco){
-		return 0;
-	}
 	if(ptinrect(wl->mouse.xy, wl->csd_rects.button_close)){
 		wlclose(wl);
 		return 1;
@@ -422,8 +419,10 @@
 		wl->mouse.buttons &= ~m;
 
 	wl->mouse.msec = time;
-	if(state && !csd_handle_mouse(wl, button, serial))
-		absmousetrack(wl->mouse.xy.x, wl->mouse.xy.y, wl->mouse.buttons, wl->mouse.msec);
+	if(state && wl->client_side_deco && csd_handle_mouse(wl, button, serial))
+		return;
+
+	absmousetrack(wl->mouse.xy.x, wl->mouse.xy.y, wl->mouse.buttons, wl->mouse.msec);
 }
 
 static void