Windows can get in a state when it stops reporting raw input events for game controllers until reboot.
The downside of this change is that we lose support for trigger rumble and are limited to 4 controllers again, but if that's important for your application you can use SDL_SetHint(SDL_HINT_JOYSTICK_RAWINPUT, true) to enable this functionality.
Fixes https://github.com/libsdl-org/SDL/issues/13047
Using processed timestamps can result in anomalies that cause excessive repeat events, and hard caps can cause issues.
In the key event handler, use the raw elapsed time to calculate any remaining repeat events to avoid the artifacts that can result from using processed timestamps.
The Wayland key repeat rate ranges from 0 to 1000 per second, so millisecond resolution doesn't lose any precision.
More non-compositing window managers than just openbox seem to need this, so always force sending the window position and dimensions when entering/leaving fullscreen. If they are wrong, they will be immediately overwritten by the correct dimensions from a subsequent ConfigureNotify event.
This is disabled on XWayland, as it seems to cause hitching on some compositors.
This mostly fixes stylistic issues, but also fixes an issue with some
controllers where an erroneous check would clear the DLI flag, offsetting the
share button index so it wouldn't work.
Cap the elapsed time to something sane in case the compositor sends a bad timestamp, which can result it in it looking like the key has been pressed for a *very* long time, bringing everything to a halt while it tries to enqueue all the repeat events.
The function SDL_GetCurrentKeymap() would return null instead of the actual bound keymap for non-latin layouts if certain mapping options were set. Add a parameter to ignore the keymap options and always return the actual bound keymap, which is needed in the Wayland backend to avoid spamming keymap changed events on every keystroke with certain layouts.