~eliasnaur/gio-patches

gio: app: [Wayland] scale pointer hotspot coordinates v1 PROPOSED

Chris Waldon: 1
 app: [Wayland] scale pointer hotspot coordinates

 1 files changed, 1 insertions(+), 1 deletions(-)
#791584 apple.yml success
#791585 freebsd.yml success
#791586 linux.yml success
#791587 openbsd.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/33421/mbox | git am -3
Learn more about email & git

[PATCH gio] app: [Wayland] scale pointer hotspot coordinates Export this patch

This commit updates the way that we change cursors so that the
hotspot of the cursor is properly set to surface-local coordinates.
The previous raw hotspot coordinates are relative to the cursor
image buffer data, and do not take the buffer's scaling factor
into account.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
---
 app/os_wayland.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/os_wayland.go b/app/os_wayland.go
index dc5da440..69c5ced4 100644
--- a/app/os_wayland.go
+++ b/app/os_wayland.go
@@ -1143,7 +1143,7 @@ func (w *window) setCursor(pointer *C.struct_wl_pointer, serial C.uint32_t) {
	if buf == nil {
		return
	}
	C.wl_pointer_set_cursor(pointer, serial, w.cursor.surf, C.int32_t(img.hotspot_x), C.int32_t(img.hotspot_y))
	C.wl_pointer_set_cursor(pointer, serial, w.cursor.surf, C.int32_t(img.hotspot_x/C.uint(w.scale)), C.int32_t(img.hotspot_y/C.uint(w.scale)))
	C.wl_surface_attach(w.cursor.surf, buf, 0, 0)
	C.wl_surface_damage(w.cursor.surf, 0, 0, C.int32_t(img.width), C.int32_t(img.height))
	C.wl_surface_commit(w.cursor.surf)
-- 
2.36.1
gio/patches: SUCCESS in 19m59s

[app: [Wayland] scale pointer hotspot coordinates][0] from [Chris Waldon][1]

[0]: https://lists.sr.ht/~eliasnaur/gio-patches/patches/33421
[1]: mailto:christopher.waldon.dev@gmail.com

✓ #791586 SUCCESS gio/patches/linux.yml   https://builds.sr.ht/~eliasnaur/job/791586
✓ #791585 SUCCESS gio/patches/freebsd.yml https://builds.sr.ht/~eliasnaur/job/791585
✓ #791587 SUCCESS gio/patches/openbsd.yml https://builds.sr.ht/~eliasnaur/job/791587
✓ #791584 SUCCESS gio/patches/apple.yml   https://builds.sr.ht/~eliasnaur/job/791584
Thanks, merged.

Elias