SDL_GetWindowDisplayScale() should be preferred over SDL_GetDisplayForWindow() + SDL_GetDisplayContentScale() for querying the per-window content scale, as the former provides a more accurate and current value for individual windows, as the per-window value can differ from the base display scale value, particularly on high-DPI and multi-monitor desktops.
It is not uncommon for clients to redundantly set the window size and position, either as a holdover from an SDL 1 port, when this was required, due to any window state change triggering a universal update function that sets all window state, even if unnecessary (e.g. always calling SDL_SetWindowSize(), even if the window is fullscreen), or due to the use of compatability layers. Historically, these clients expect that their behavior won't override the base window state, which is an assumption that the windowing changes in SDL 3 broke by caching size and position changes that can't be applied immediately.
This change drops size and position requests when the window is in the maximized and fullscreen states (fullscreen-desktop windows will be repositioned, but the non-fullscreen floating position will not be overwritten), which is behavior more in line with existing client assumptions, and should ease the porting process, as well as prevent annoying bugs when older software is run via sdl2-compat.
In the process of making these changes, pending window state has been moved to separate variables in the SDL_Window struct, as this fixes bugs regarding fullscreen display selection and centering windows immediately after resize on asynchronous platforms, which had issues due to pending state possibly being overwritten.
This is a hard requirement on Apple platforms and while most other platforms don't have a concept of main thread, all video and input functions should be called on the same thread.
Everything in SDL3 up to the ABI lock is reported as available since 3.1.3.
Everything else will be reported as since 3.2.0 (what will be the first
official release).
Also ran a Perl script over the headers to change everything to 3.1.3 that
wasn't an API function, since fnsince.pl can't manage those. If there's a
macro or datatype that has snuck in that needs to be 3.2.0 instead, we'll
have to manually fix it up, but it shouldn't be a big deal in any case.
Reference PR #11304.
Updates some documentation to correspond with changes made since it was originally written, clarifies some function behavior, and includes some assorted typo fixes.
We require stdbool.h in the build environment, so we might as well use the plain bool type.
If your environment doesn't have stdbool.h, this simple replacement will suffice:
typedef signed char bool;