Contents

Mouse lock on Wayland

Fixing first-person and right-click camera on Wayland desktops with the pointer-lock patch.

Roblox turns the camera by pinning the cursor to one pixel and reading the mouse's motion. On a Wayland desktop, Roblox runs through Xwayland, and the stock Xwayland does not pass that pin on to the compositor properly. You will recognise it:

  • in first person, or with shift lock, the pointer drifts and the camera stops turning when it reaches the edge of the window;
  • dragging with the right mouse button turns the camera a little, then stops.

The same game works on an X11 session. Continuum fixes it on Wayland with a patched Xwayland, which Volt calls the Xwayland Pointer-Lock Patch.

Installing it

Open Settings › Continuum › Add-ons. The Xwayland Pointer-Lock Patch row names your compositor and says whether the patch is installed, and whether your desktop needs root for it. Press Install. Volt downloads the patch, checks it against Continuum's release key, checks that it starts on your system, and keeps your current Xwayland if that check fails.

The row reads "No supported Wayland compositor found" on an X11 session, or when Volt does not recognise your compositor; there is nothing to install then.

How the patch is put in place depends on how your compositor finds Xwayland. Volt works that out and does the right thing; this is what happens on each.

DesktopHow the patch is installedWhen it takes effect
KDE Plasma (tested)In your home folder, no root neededStraight away with Restart Xwayland…, or at your next login
Hyprland, COSMIC, niriIn your home folder, no root neededAt your next login
Sway, river, labwc, Wayfire, dwl, hikari, mangoIn your home folder, plus a setting in ~/.config/environment.dAt your next login
GNOMEAs root, after your passwordAt your next login

Restarting Xwayland, by hand or by logging out, closes every X11 window: Roblox, other Wine programs, and Electron apps such as Discord when they run through X11. Save your work in them first.

KDE Plasma

Plasma looks Xwayland up by name, so Volt installs the patch in your home folder, as ~/.local/bin/Xwayland. To switch without logging out, press Restart Xwayland… on the row: Volt lists the X11 apps that will close and asks first, then restarts Xwayland, and KWin starts the patched one with the next X11 app. The row then says the patched build is running. Volt refuses the restart when its own window runs on X11, since it would close itself.

Hyprland, COSMIC and niri

These compositors also look Xwayland up by name, so the patch goes in the same place. They are not known to start a new Xwayland cleanly when it is restarted, so log out and back in to switch to it.

On Hyprland, Roblox's cursor can freeze on screen in fullscreen, for example while you hold the right mouse button to turn the camera, while the real pointer keeps moving: the game's buttons react to a cursor you cannot see, and Alt-Tab unsticks it. That is Hyprland drawing the cursor in fullscreen, not the patch. Add this to ~/.config/hypr/hyprland.conf:

ini
render {
    direct_scanout = 0
}
cursor {
    no_hardware_cursors = true
}

Sway and other wlroots compositors

wlroots compositors start the Xwayland named in WLR_XWAYLAND. Volt installs the patch in your home folder and writes ~/.config/environment.d/90-continuum-xwayland.conf, which sets that variable for your next login.

Sessions started through systemd, for example with uwsm, read that folder. Many display managers and TTY setups do not; if the row still does not show the patch as running after logging back in, set the variable wherever your compositor is started:

sh
export WLR_XWAYLAND="$HOME/.local/bin/Xwayland"

On mango (MangoWC), the simplest place is its own config, ~/.config/mango/config.conf, which mango reads before it starts Xwayland however it was launched. Use the full path, with your home folder spelled out:

ini
env=WLR_XWAYLAND,/home/you/.local/bin/Xwayland

GNOME

GNOME always starts /usr/bin/Xwayland, so the patch can only take its place with root. Volt asks first, under the row: Install as Root asks for your password and does it, and Show Commands shows the commands to run in a terminal yourself. They copy the patch to /usr/local/lib/continuum-xwayland, bind-mount a small wrapper over /usr/bin/Xwayland, and add the mount to /etc/fstab so it survives reboots. Nothing under /usr is changed, which also makes it work on image-based systems such as Silverblue. Log out and back in afterwards.

When ~/.local/bin is not searched

On a compositor that looks Xwayland up by name, the home-folder install only works if ~/.local/bin comes before /usr/bin in the compositor's search path. When it does not, as on some Hyprland setups, the patch goes under /usr/local instead, which needs root: Volt offers Install as Root and Show Commands as on GNOME.

Requirements

Your compositor needs the standard pointer-constraints and relative-pointer support, which every major one has. The patched Xwayland itself runs on any glibc 2.35+ x86_64 distribution with a normal graphics stack (Mesa or NVIDIA) and the usual keyboard layouts in /usr/share/X11/xkb. It does not run on musl distributions or on NixOS.

Things to know

  • The lock engages where the pointer is. Start a right-click drag with the pointer over the game window.
  • A Wine session that outlives its X server crashes the next program with a BadWindow error. If Xwayland restarts while Roblox or anything else runs in the prefix, use Clean Up… under Settings › Continuum › Prefix › Running before launching again.
  • On Plasma, if X11 programs stop opening altogether after Xwayland restarted, KWin has given up on Xwayland for the session. Log out and back in.
  • To check which Xwayland is running, look at the Xwayland Pointer-Lock Patch row, or run readlink /proc/$(pgrep -x Xwayland)/exe.
  • When a newer patch is out, the row offers Update to that version.

Removing it

Press Uninstall on the row, then log out and back in. For a GNOME or /usr/local install, Volt offers Uninstall as Root, or the commands that undo it. Uninstall › Everything under Settings › Continuum removes the patch too.

To remove a home-folder install by hand:

sh
rm ~/.local/bin/Xwayland
rm -rf ~/.local/lib/continuum-xwayland
rm -f ~/.config/environment.d/90-continuum-xwayland.conf

then log out and back in.