Skip to content

Commit

Permalink
Sync SDL3 header -> wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
SDLWikiBot committed May 3, 2024
1 parent b4d1e27 commit a7f0a11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
5 changes: 3 additions & 2 deletions SDL3/README/wayland.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()```

Expand Down
20 changes: 11 additions & 9 deletions SDL3/SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -15,17 +15,19 @@ Defined in [<SDL3/SDL_hints.h>](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
Expand Down

0 comments on commit a7f0a11

Please sign in to comment.