[client] wayland: constrain pointer only during capture
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled

Remove the persistent confined-pointer workaround that emulated cursor
warping on Wayland. Normal pointer motion now uses absolute input only.

Create relative and locked pointer objects only during capture. Preserve
the request across pointer capability changes, and suppress relative
events until the compositor confirms the lock.

On uncapture, publish the current absolute position instead of trying to
warp the host cursor.
This commit is contained in:
Geoffrey McRae
2026-08-09 03:32:38 +10:00
parent 48f0b66a4f
commit 9f2d6f6413
9 changed files with 124 additions and 531 deletions

View File

@@ -123,7 +123,6 @@ struct WaylandHDRParameters
struct WaylandDSState
{
_Atomic(bool) confActive;
_Atomic(bool) lockActive;
bool keyboardGrabbed;
bool pointerInSurface;
@@ -143,7 +142,6 @@ struct WaylandDSState
bool fractionalScale;
bool needsResize;
bool configured;
bool warpSupport;
struct WlMotion motion;
double scrollState;
@@ -196,11 +194,8 @@ struct WaylandDSState
struct zwp_relative_pointer_manager_v1 * relativePointerManager;
struct zwp_pointer_constraints_v1 * pointerConstraints;
struct zwp_relative_pointer_v1 * relativePointer;
struct zwp_confined_pointer_v1 * confinedPointer;
struct zwp_locked_pointer_v1 * lockedPointer;
struct wl_callback * confSync;
bool confReq;
bool inputLive;
bool captureRequested;
bool showPointer;
uint32_t pointerEnterSerial;
@@ -392,7 +387,8 @@ bool waylandIsPointerGrabbed(void);
bool waylandIsPointerCaptured(void);
void waylandRealignPointer(void);
void waylandWarpPointer(int x, int y, bool exiting);
void waylandGuestPointerUpdated(double x, double y, double localX, double localY);
void waylandGuestPointerUpdated(double x, double y, double localX,
double localY);
bool waylandGetKeyLabel(int key, char * label, size_t size);
// output module
bool waylandOutputInit(void);