XWayland emulates the XRandR interface, so it still needs the actual mode switch call to trigger the mode switching emulation.
There is also no need to wait when using XWayland mode switching emulation, as it is handled via viewport scaling and thus instantaneous.
Otherwise, when you call SDL_CreateCondition() in something that can otherwise
survive in a single-threaded build, you'll get an error that seems fatal.
We already do this for mutexes and rwlocks (but not semaphores!)
Fixes#9558.
This allows using a much smaller (1.5 KB) lookup table, in exchange for a small amount of extra work per frame.
The extra work (a few extra loads/mul/adds) is negligible, and can execute in parallel.
The reduction in cache misses almost certainly outweighs any added cost.
The table is generated at runtime, and takes less than 0.02ms on my computer.
Compiler support for loading/storing multiple registers at once (i.e vld1q_f32_x4) seems very poor, so avoiding them for now.
Also switched to aligned stores with SSE. Although both SSE and NEON support unaligned stores, there is more likely to be a penalty to them, i.e when crossing a cache line. So might as align them.
This clears up confusion about whether to use SDL_KeyCode or SDL_Keycode and makes it clear that the values aren't the full set of possible keycodes.
Fixes https://github.com/libsdl-org/SDL/issues/9493
XWayland seems to require that the pointer be hidden when it is warped, so hide and show the pointer when warping, if required.
Note that XWayland still only allows warping within the window, so attempts to warp to global coordinates outside the window won't work.
This could happen if `enabled` was non-zero but not set to SDL_TRUE.
Static analysis tried to warn us!!
The added SDL_assert is meant to sanity check this, not pacify the analyzer;
this passes Clang's static analysis now, with or without the assert.
Fixes#9544.
That way we don't do the awful minimise on focus loss logic by default on XWayland where mode switching is emulated (like on the Wayland backend).
This fixes CS2, Dota 2 minimising on alt-tab when playing in fullscreen (which is really annoying when managing eg. Discord on another screen)