Session: draw the program's own pointer - resize arrows at window edges, I-beams, its hide

The compositor threw every wl_pointer.set_cursor image away and the app drew one fixed arrow,
so the desktop never showed labwc's resize arrows at a window's edges and corners. Ported from
Bannerlator (7f19c669): the cursor surface gets a role, its image is snapshotted on commit with
its hotspot, and a NULL surface or buffer is an authoritative hide; the app's overlay draws the
image at the session's scale. New here: labwc on Vulkan/GLES hands its cursor over as a dma-buf
(wlroots' nested backend, usually UBWC), so it is read back through a small linear host-visible
copy (vkp_image_readback). The built-in arrow stays until a program sets a cursor.
This commit is contained in:
The412Banner committed 2026-09-25 08:28:26 -04:00
1 parent 347a5a4dcb
commit c331836bce
7 files changed
+305 -6

No files matched your search

@@ -171,6 +171,17 @@ public final class WaylandCompositor {
public static native void nativeSendTouch(int action, int pointerId, int x, int y);
/**
* The client's pointer image, straight from wl_pointer.set_cursor (labwc's resize arrows, a text
* field's I-beam). out = [serial, hidden, w, h, hotspotX, hotspotY, ARGB8888 pixels...]; returns
* the number of ints written, or 0 if {@code out} is too small. Serial 0 = the client has not
* set one yet; [1] = 1 means it asked for NO pointer.
*/
public static native int nativeCursorSnapshot(int[] out);
/** Enough for the header plus a 256x256 cursor, the largest the compositor snapshots. */
public static final int CURSOR_BUF_INTS = 6 + 256 * 256;
/** Inject a key event. evdev = Linux input keycode (KEY_A=30…); state: 1=down, 0=up. */
public static native void nativeSendKey(int evdev, int state);