shithub: drawterm

Download patch

ref: 671477fdba0362f603b387bc121d6fdedf67a7af
parent: dd03ed16b32bb83bca47fa916291102f9cc78f4b
author: Jacob Moody <moody@posixcafe.org>
date: Tue Oct 12 14:09:38 EDT 2021

Provide cursor hot spot to wayland

--- a/gui-wl/wl-cb.c
+++ b/gui-wl/wl-cb.c
@@ -303,7 +303,7 @@
 	wl->pointerserial = serial;
 	if(wl->cursorsurface == nil)
 		return;
-	wl_pointer_set_cursor(wl->pointer, wl->pointerserial, wl->cursorsurface, 0, 0);
+	wl_pointer_set_cursor(wl->pointer, wl->pointerserial, wl->cursorsurface, -cursor.offset.x, -cursor.offset.y);
 }
 
 static void
--- a/gui-wl/wl-screen.c
+++ b/gui-wl/wl-screen.c
@@ -171,7 +171,7 @@
 setcursor(void)
 {
 	qlock(&drawlock);
-	wldrawcursor(snarfwin, &arrow);
+	wldrawcursor(snarfwin, &cursor);
 	qunlock(&drawlock);
 }
 
--- a/gui-wl/wl-util.c
+++ b/gui-wl/wl-util.c
@@ -149,5 +149,5 @@
 	wl->cursorsurface = wl_compositor_create_surface(wl->compositor);
 	wl_surface_attach(wl->cursorsurface, wl->cursorbuffer, 0, 0);
 	wl_surface_commit(wl->cursorsurface);
-	wl_pointer_set_cursor(wl->pointer, wl->pointerserial, wl->cursorsurface, 0, 0);
+	wl_pointer_set_cursor(wl->pointer, wl->pointerserial, wl->cursorsurface, -c->offset.x, -c->offset.y);
 }