SDL_WarpMouseInWindow unimplemented on Wayland Linux display

This is just to publicly document this unimplemented capability, as it took me a day of hunting around to figure out what was going on and I couldn’t find any information on the internet that gave me an easy answer.

After compiling my code using SDL 2.0.6 on a new installation of Ubuntu 17.10, I am seeing SDL_WarpMouseInWindow() not work when running the wayland display server–the same executable works fine when I run the Xorg xserver, and fine on osx and windows.

After digging into the 2.0.7 source code, I see in src/video/wayland/SDL_waylandmouse.c

static void
Wayland_WarpMouse(SDL_Window *window, int x, int y)
{
    SDL_Unsupported();
}

static int
Wayland_WarpMouseGlobal(int x, int y)
{
    return SDL_Unsupported();
}

Suggesting that the functionality is unimplemented–but I haven’t seen this documented anywhere. There were no warning/error messages reported, so it is failing silently with no explanation.

Here is some discussion about an approach to implementing this, as it looks like this is not a supported function in Wayland: