From 93f50d20a021150a0b95242be0d5dd5cae9d0185 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Sat, 11 Apr 2026 19:06:35 +0900 Subject: plan and research --- .rules/plan/phase-09-cursor.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .rules/plan/phase-09-cursor.md (limited to '.rules/plan/phase-09-cursor.md') diff --git a/.rules/plan/phase-09-cursor.md b/.rules/plan/phase-09-cursor.md new file mode 100644 index 0000000..11d301f --- /dev/null +++ b/.rules/plan/phase-09-cursor.md @@ -0,0 +1,30 @@ +# Phase 9 — Cursor Rendering + +--- + +## Step 9.1 — Render the cursor in the compositor + +Since compositing may obscure the hardware cursor in certain +configurations, render it ourselves: + +1. Call `XFixesGetCursorImage(dpy)` to get the current cursor bitmap + (ARGB pixel data, width, height, hotspot). +2. Convert to a raylib `Texture2D`. +3. Draw it at the pointer position each frame (query with + `XQueryPointer()`). +4. Optionally call `XFixesHideCursor()` on the root and draw our own + cursor exclusively. + +Subscribe to cursor change notifications: + +```c +XFixesSelectCursorInput(dpy, root, XFixesDisplayCursorNotifyMask); +``` + +Cache the cursor texture and only update it when an +`XFixesCursorNotify` event fires (cursor shape changed — e.g., from +arrow to text beam when hovering over `xterm`). + +**Verify:** The cursor is visible and correct when moving over composited +windows. Cursor changes (e.g., text cursor in xterm, resize arrows at +window edges) are reflected. No flickering or offset. -- cgit v1.2.3