commit d1ec3e2

shrub  ·  2026-10-02 21:44:18 +0000 UTC
parents 1fdeebd, 35d8564
Merge branch 'main' of git.sr.ht:~shrub900/neuswc
2 files changed,  +24, -0
+14, -0
 1@@ -152,6 +152,20 @@ swc_cursor_position(int32_t *x, int32_t *y)
 2 	return true;
 3 }
 4 
 5+EXPORT bool
 6+swc_cursor_set_position(int32_t x, int32_t y)
 7+{
 8+	if (!swc.seat || !swc.seat->pointer) {
 9+		return false;
10+	}
11+
12+	pointer_handle_absolute_motion(swc.seat->pointer, get_time(),
13+	                               wl_fixed_from_int(x), wl_fixed_from_int(y));
14+	pointer_handle_frame(swc.seat->pointer);
15+
16+	return true;
17+}
18+
19 EXPORT bool
20 swc_initialize(struct wl_display *display, struct wl_event_loop *event_loop,
21                const struct swc_manager *manager)
+10, -0
 1@@ -48,6 +48,16 @@ struct wld_buffer;
 2 bool
 3 swc_cursor_position(int32_t *x, int32_t *y);
 4 
 5+/**
 6+ * Set the cursor position.
 7+ *
 8+ * The coordinates are in compositor-global space, exposed as raw int32_t
 9+ * to avoid needing wayland headers. This has the same effect as the
10+ * cursor being moved there by an input device.
11+ */
12+bool
13+swc_cursor_set_position(int32_t x, int32_t y);
14+
15 /**
16  * Send a pointer button event to the currently focused client.
17  *