bge.render.setMousePosition fails silently with Xwayland
Open, Needs TriagePublic


System Information
Operating system and graphics card
Fedora 26 Linux 4.15.6-200.fc26.x86_64 + Intel HD Graphics 530 + GeForce GTX 960M
with Xwayland

Blender Version
Broken: blender-2.79-linux-glibc219-x86_64 5bcd8ac9adbfa (from d.b.o)
Worked: same version with Xorg instead of Xwayland

Short description of error
bge.render.setMousePosition works with X server, but it fails silently with Xwayland.

Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps

import bge
bge.logic.mouse.visible = True
center = bge.render.getWindowWidth() // 2, bge.render.getWindowHeight() // 2



a temp workaround is to place a object that is a mouse representative,
use simpleMouse or your own code to manage your own X offset and Y offset from frame to frame,

use camera projection matrix to raycast instead of using mouseover.hitObject()

if you need a temp work around let me know

(I did this in the past to avoid the mouse moving at all when it's supposed to be locked in a place)

Follow up, my ticket might have lack details. The problem is that the mouse used to be looked to the viewer using ""mouse look" script.

My current workaround is to use movement delta instead of relative to window center.

However, since Wayland, the mouse is not moved by setMousePosition(), and get out of the window.