diff --git a/SDL3/README/wayland.md b/SDL3/README/wayland.md index 6b4aa6ce2..6dac845ca 100644 --- a/SDL3/README/wayland.md +++ b/SDL3/README/wayland.md @@ -39,9 +39,10 @@ encounter limitations or behavior that is different from other windowing systems unknown. In most cases, applications don't actually need the global cursor position and should use the window-relative coordinates as provided by the mouse movement event or from ```SDL_GetMouseState()``` instead. -### Warping the global mouse cursor position via ```SDL_WarpMouseGlobal()``` doesn't work +### Warping the mouse cursor to or from a point outside the window doesn't work -- For security reasons, Wayland does not allow warping the global mouse cursor position. +- The cursor can be warped only within the window with mouse focus, provided that the `zwp_pointer_confinement_v1` + protocol is supported by the compositor. ### The application icon can't be set via ```SDL_SetWindowIcon()``` diff --git a/SDL3/SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP.md b/SDL3/SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP.md index b0bea8096..49a9a9077 100644 --- a/SDL3/SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP.md +++ b/SDL3/SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP.md @@ -1,7 +1,7 @@ ###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!) # SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP -Enable or disable mouse pointer warp emulation, needed by some older games. +Enable or disable hidden mouse pointer warp emulation, needed by some older games. ## Header File @@ -15,17 +15,19 @@ Defined in [](https://github.com/libsdl-org/SDL/blob/main/incl ## Remarks -Wayland does not directly support warping the mouse. When this hint is set, -any SDL will emulate mouse warps using relative mouse mode. This is -required for some older games (such as Source engine games), which warp the -mouse to the centre of the screen rather than using relative mouse motion. -Note that relative mouse mode may have different mouse acceleration -behaviour than pointer warps. +Wayland requires the pointer confinement protocol to warp the mouse, but +that is just a hint that the compositor is free to ignore, and warping the +the pointer to or from regions outside of the focused window is prohibited. +When this hint is set and the pointer is hidden, SDL will emulate mouse +warps using relative mouse mode. This is required for some older games +(such as Source engine games), which warp the mouse to the centre of the +screen rather than using relative mouse motion. Note that relative mouse +mode may have different mouse acceleration behaviour than pointer warps. The variable can be set to the following values: -- "0": All mouse warps fail, as mouse warping is not available under - wayland. +- "0": Attempts to warp the mouse will be made, if the appropriate protocol + is available. - "1": Some mouse warps will be emulated by forcing relative mouse mode. If not set, this is automatically enabled unless an application uses