Package: libsdl2-2.0-0
Version: 2.0.4+dfsg2-1
Severity: normal
Tags: patch

Games that rely on locking the mouse pointer, such as quake3 and openarena,
don't work in a Wayland session (for example see
<>). There are two main failure modes,
assuming the usual first-person-shooter control scheme where moving the
mouse controls yaw (look left/right) and pitch (look up/down):

A. players cannot turn all the way around, because the pointer stops at the
   edge of the screen
B. players look straight down and spin uncontrollably, because the
   game's input subsystem thinks it has enabled pointer-locking but
   in fact has not

ioquake3 currently exhibits symptom A when forcing native Wayland
(e.g. `SDL_VIDEODRIVER=wayland openarena`) and symptom B when using the X11
protocol via XWayland (run `openarena` with SDL_VIDEODRIVER unset), both
under a GNOME Shell Wayland session.

The attached patch 0003 corrects symptom A when forcing native
Wayland, by pulling in some patches from SDL hg master which are expected
to be released in 2.0.5. Fixing the XWayland case will require changes
to src:xorg-server
<>), which
should be released in about a month, and unfortunately are an ABI break
(hence difficult to backport); hopefully SDL X11 changes shouldn't be
needed for that code path.

While checking whether the defined(__FREEBSD__) conditionals were right
(they should probably be defined(__FREEBSD__) || defined(__FreeBSD_kernel__))
I noticed that the checks for kFreeBSD and Hurd in debian/rules are
a bit broken. Patches 0001 and 0002 address that.

I also wonder whether it would be better for SDL2 to default to native
Wayland/Mir when available, by moving the Wayland/Mir blocks in the
bootstrap[] array above the X11 block. The advantage of this would be
that support isn't constrained by X11 and XWayland (or Mir equivalent)
and SDL2 can use any protocol supported by both SDL2 and the Wayland/Mir
compositor; the disadvantage would be that if a developer runs Weston
inside X11 (a Xephyr-like setup), games and other SDL2 apps would default
to using Wayland and appearing inside the Weston window, which might be
unexpected. This change hasn't happened upstream, and I haven't provided
a patch here either (although it's easy to do); comments on that welcome.

Thanks for considering,

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libsdl2-2.0-0 depends on:
ii  libasound2                              1.1.2-1
ii  libc6                                   2.24-3
ii  libpulse0                               9.0-3
ii  libsndio6.1                             1.1.0-2
ii  libwayland-client0                      1.11.0-2
ii  libwayland-cursor0                      1.11.0-2
ii  libwayland-egl1-mesa [libwayland-egl1]  12.0.3-1
ii  libx11-6                                2:1.6.3-1
ii  libxcursor1                             1:1.1.14-1+b1
ii  libxext6                                2:1.3.3-1
ii  libxi6                                  2:1.7.6-1
ii  libxinerama1                            2:1.1.3-1+b1
ii  libxkbcommon0                           0.6.1-1
ii  libxrandr2                              2:1.5.0-1
ii  libxss1                                 1:1.2.2-1
ii  libxxf86vm1                             1:1.1.4-1

libsdl2-2.0-0 recommends no packages.

libsdl2-2.0-0 suggests no packages.

-- no debconf information

Reply via email to