diff options
Diffstat (limited to '.rules/plan/phase-09-cursor.md')
| -rw-r--r-- | .rules/plan/phase-09-cursor.md | 30 |
1 files changed, 30 insertions, 0 deletions
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. |
