This allows threads to free memory from their local pool without affecting events that are queued, and to transfer memory ownership cleanly between threads that are queuing and dequeuing events.
Always use the size sent by the compositor when transitioning back to the floating state on the xdg-toplevel path, unless the client explicitly requested a new floating size while the window was in a fixed-size state.
If a window is requested to be maximized or made fullscreen while an uncommitted size request is pending, the surface will first be committed so that the compositor will set the new size when the window is restored.
Fixes the window being wrongly resized when leaving the maximized state in KDE.
This restores the behaviour before 9221548114 where we only preventDefault the event if:
- the key is recognised
- the event is enabled
- the event is not filtered
(ignoring the KEYPRESS special case, which is unchanged)
(cherry picked from commit 6e931bee01b34a9f7a51579bcaf9a95f7f9451ce)
This more closely matches the mental model of people using SDL, and locking a surface that isn't RLE encoded doesn't cause any issues.
Fixes https://github.com/libsdl-org/SDL/issues/5594
The function can now convert between pixels of different formats, and takes a parameter to control whether the premultiplication is done in sRGB or linear space.
Also added SDL_PremultiplySurfaceAlpha(), which can premultiply the pixels of a surface in-place.
Applying these changes to external code doesn't actually improve anything, and within the context of the other Get* functions for renderers and surfaces, these stand out as outliers, so I'm going to back this change out.
Fixes a type redefinition error:
In file included from /tmp/SDL3/test/../src/events/SDL_events_c.h:28,
from /tmp/SDL3/test/../src/events/SDL_pen.c:26,
from /tmp/SDL3/test/testautomation_pen.c:83:
/tmp/SDL3/test/../src/events/../video/SDL_sysvideo.h:34: error: redefinition of typedef 'SDL_DisplayModeData'
/tmp/SDL3/include/SDL3/SDL_video.h:78: note: previous declaration of 'SDL_DisplayModeData' was here
This was done to SDL_DisplayMode for consistency with SDL_Surface and gives it a type so we don't have to do casts in SDL code.
I considered switching to an ID and hashing the driver data, etc. but all of that involved a lot of internal code churn and this solution gives us flexibility in how we handle this in the future.
After consideration, I made this renaming global across the project, for consistency.
Fixes https://github.com/libsdl-org/SDL/issues/10198
It also now caches at the higher level, so the platform-specific bits don't
change their interface much.
A little code hygiene work was applied to some of the platform bits on top of
this.
Reference Issue #10229.