diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 16:23:07 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 16:23:07 +0300 |
| commit | 276a70a84fed5be229c12546df1ac393158a4ec9 (patch) | |
| tree | f3d0e00d6339efacc466b32048644c388315e90d /docs | |
| parent | 138b9c40aa211edff1d0201083aa25a8b467ee15 (diff) | |
Implement relative pointer mode on Wayland
yasl_surface_set_pointer_mode(YASL_POINTER_RELATIVE) now takes a
persistent zwp_locked_pointer_v1 on the surface and hides its cursor.
While the compositor keeps the lock engaged, zwp_relative_pointer_v1
motion is pushed as POINTER_MOTION with pos frozen and delta in device
pixels. When the lock disengages, as on focus loss, motion is absolute
again with a delta derived by the input queue.
The lock follows the pointer's seat: it moves to another seat when its
seat loses the pointer, and is released on NORMAL and on surface
destruction. Compositors without both protocols return false.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/guide.md | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/guide.md b/docs/guide.md index a65972f..62c2e1a 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -224,8 +224,12 @@ meaningless. `POINTER_MOTION` reports `delta`, the device-pixel movement since the previous sample, which restarts from zero after enter, leave, or reset. `yasl_surface_set_pointer_mode()` with `YASL_POINTER_RELATIVE` hides and locks the cursor while the surface is focused; motion then carries unbounded `delta` and -`pos` stays at the lock position. No backend implements it yet, so it -currently returns false and leaves the surface in `YASL_POINTER_NORMAL`. Pen +`pos` stays at the lock position. Wayland implements it with the +relative-pointer and pointer-constraints protocols, reporting the compositor's +accelerated motion in device pixels. The compositor decides when the lock +engages; until then, and while it is released on focus loss, motion stays +absolute with a computed `delta`. X11, Cocoa, and compositors without those +protocols return false and keep the current mode. Pen pressure is normalized to 0..65535, signed tilt is in degrees, and missing axes are zero. Pressure-only changes can produce motion. Zero pressure alone does not mean release. This interface does not expose simultaneous touch contacts. |
