Silly XFCE feature+bug breaks relative mouse mode

In Yamagi Quake II we got a bugreport about mouse grabbing failing with fullscreen windows.
It turned out that the reporter configured their XFCE to switch the workspace if the mouse cursor reaches the display border (Settings => Window Manager => Advanced => Wrap workspace when reaching the screen edge => [x] With the mouse pointer).
I personally find this feature completely annoying, but whatever, it’s there and apparently people are using it…
The problem is that XFCE switches the workspace even if SDL grabs the cursor (SDL_SetWindowGrab(), which calls XGrabPointer() under the hood) - YQ2 calls both SDL_SetWindowGrab(window, SDL_TRUE) and SDL_SetRelativeMouseMode(SDL_TRUE).

I think it’s completely broken on XFCE’s side to do this even though a window is grabbing the cursor, but I still wonder if SDL could/should work around this?
Especially when using relative mouse mode (where I think by default the X cursor events are ignored and raw mouse events are used) it might be possible to confine the cursor in a small section in the middle of the window, possibly with XFixesCreatePointerBarrier()?

The YQ2 bugreport mentions the same problem with KDE on Wayland, but I haven’t looked further into that - maybe the underlying problem is similar, maybe it’s a bug in SDL’s Wayland code, no idea, I have no experience with Wayland.

UPDATE: I reported the bug at XFCE, I’m curious if they’ll fix it: https://gitlab.xfce.org/xfce/xfwm4/-/issues/427

I got a reply in the XFCE bugtracker:

The problem is that you use the core X11 protocol whereas xfwm4 uses Xinput2.

If you try with an X11 client which uses XI2 such as a menu in a gtk application for example, it works (I mean, the workspace won’t switch).

That raises the question whether we should just drop XI2 support in xfwm4…

I’m not sure what to do with that information, I’m not super familiar with X11 programming… I’ve asked for further information on what SDL2 could do to work around this issue (but also said it’d make sense for them to fix it because not every affected game/application uses SDL2).

I’m kinda surprised that apparently XI2 does not seem to interact well with “core” X11 code :-/

I also realized that just confining the cursor to a smaller section within the window is not an optimal solution - it doesn’t matter for relative mouse mode, but for fullscreen games that use the cursor (e.g. strategy games where moving the cursor to the edge of the window is supposed to scroll the world) it’d suck.