Skip to content

Wayland ignores client warping. (Mouse) #1994

@lordloki

Description

@lordloki

Move SimonArt issue from Blenderartists and UPBGE discord:

UPBGE: 0.4.4 (player + in-Blender)

OS/DE: KDE Plasma (Wayland, KWin)

GPU/Driver: rtx 4090 (Laptop)

Mode: Windowed (not fullscreen)

Problem
On Wayland, render.showMouse(False) + reading logic.mouse.position and trying to recenter with render.setMousePosition() doesn’t actually confine/capture the cursor. The pointer can leave the game window, clicks hit other windows, and yaw/pitch drift or stop when focus changes. In fullscreen it’s inconsistent; under X11/XWayland (or via gamescope) it works as expected.

Why
Wayland ignores client warping. Proper FPS behavior needs the Wayland protocols:

zwp_pointer_constraints_v1 (lock/confine)

zwp_relative_pointer_v1 (relative motion)

These must be requested by the engine/window backend; Python scripts can’t do it.

Ask

Expose a real “mouse capture / relative mode” at engine level on Wayland, e.g.:

bge.render.setMouseCapture(True/False) or

bge.render.setRelativeMouseMode(True/False)

Under the hood, use pointer-constraints + relative-pointer via Blender’s GHOST Wayland backend and feed relative deltas to BGE.

Optional: auto-capture on game start, release on ESC or window blur.

Repro

Run a simple mouselook (reads logic.mouse.position deltas) in windowed mode on Wayland.

Pointer escapes window; focus/clicks go to other apps; rotation breaks.

Same file on X11/XWayland (or gamescope -- upbge-player file.blend) behaves correctly.

Workarounds known

Use X11/XWayland session

Run under gamescope

Fullscreen sometimes helps, not reliable

Is there any hidden setting I’ve missed? If not, could this be added to UPBGE so Wayland matches X11 behavior? Thanks!

https://blenderartists.org/t/upbge-0-4-x-on-kde-wayland-mouse-won-t-lock-in-windowed-mode-mouselook-stalls-at-screen-edge/1610590/3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions