diff options
| author | Adam Malczewski <[email protected]> | 2026-04-11 19:06:35 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-04-11 19:06:35 +0900 |
| commit | 93f50d20a021150a0b95242be0d5dd5cae9d0185 (patch) | |
| tree | 48054581d580974651260900d1ef79d370872952 /.rules/plan/phase-09-cursor.md | |
| download | winman-raylib-93f50d20a021150a0b95242be0d5dd5cae9d0185.tar.gz winman-raylib-93f50d20a021150a0b95242be0d5dd5cae9d0185.zip | |
plan and researchmain
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. |
