Sticky cursor around the visible area of RGUI on Wayland

Hi there,

Running RetroArch on Wayland compositors (Weston, Sway, tinywl) I found out that the cursor gets sticky when it gets to the edges of the visible area.

That’s because the pointer coordinates are NOT confined to the visible area.

Typically, zwp_pointer_constraints_v1_confine_pointer() would be used for pointer confination on the visible area, like libSDL2 does on it’s Wayland_input_confine_pointer function here:

…But I don’t even see if/where RetroArch should be trying to confine it’s pointer. There’s not even mention of cursor confination on the Wayland input driver code. Also, I can’t see “wayland” as a selectable input driver in RetroArch, but input/drivers/wayland_input.c is being built.

This seems to affect dosbox-core, too.

Any ideas?

Would this need to be behind the mouse capture toggle? That is, would this trap the cursor in the window?

It would need to trap the mouse on the visible area of the fullscreen windows, yes.

The problem are fullscreen windows when using RGUI: pointer gets into the black columns on both sides, and even if it’s invisible there, the coordinates are still out of the visible area, thus making the cursor “sticky”.

1 Like