Commit Graph

4982 Commits

Author SHA1 Message Date
Frank Praznik
5a7e2d41b8 x11: Look for text/uri-list in the list of MIME types more thoroughly
A uri-list of files is the preferred format, so don't bail if a preferred text format is encountered first.

(cherry picked from commit 1df279a04f)
2026-03-27 12:22:34 -04:00
Strultz
b11ac0087f Fix window caption drawing on borderless windows (#15275)
(cherry picked from commit 6a9449c098)
2026-03-27 05:14:46 -07:00
c4veman
a004c1bcc4 Check Windows version before setting window attributes
(cherry picked from commit 159bba9aa1)
2026-03-26 10:44:05 -07:00
Petar Popovic
db3ff5f5c4 SDL_SetWindowShape(): Remove shape when argument is NULL
(cherry picked from commit 53c799a7a9)
2026-03-26 10:42:46 -07:00
Green Sky
4b8fcb468b video: add more direct mjpeg to yuv conversions
(cherry picked from commit 998159fa95)
2026-03-24 09:00:43 -07:00
sunshineinabox
c9271b2f18 egl: Handle error when binding EGL API in context creation
(cherry picked from commit 6b060435e3)
2026-03-20 12:28:14 -04:00
Frank Praznik
a4c326a7bb x11: More XInput2 #define cleanups
Fixes building on very old XInput2 versions (pre-2012) without smooth scrolling and multitouch.

(cherry picked from commit 62af66f14a)
2026-03-18 11:26:34 -04:00
Frank Praznik
a2fb4d6d47 x11: Fix building when XInput2 is not available
(cherry picked from commit d88f76caac)
2026-03-17 15:32:26 -04:00
Frank Praznik
b560f8ab17 wayland: Scale custom cursors with the pointer scale
When emulating display modes or using display scaling, custom cursors need to be scaled, or they can appear too large or small relative to the window size.

(cherry picked from commit 3d21b3bc68)
2026-03-17 13:28:27 -04:00
Cameron Gutman
5ee57a9da1 windows: Fix Print Screen key capture during keyboard grab
(cherry picked from commit 5f92aac095)
2026-03-15 15:35:00 -05:00
Sam Lantinga
86c664d695 Fixed error when SDL_LoadSurface_IO() is passed a NULL src
(cherry picked from commit 1d081314a8)
2026-03-15 13:17:22 -07:00
Frank Praznik
4dc440ff71 wayland: Eliminate redundant keyboard and mouse removals
The SDL keyboard and mouse will be removed when destroying the seat, so there is no need to preemptively remove them.

(cherry picked from commit 566448d95a)
2026-03-13 22:43:25 -04:00
Frank Praznik
58c9c0ba7b wayland: Prevent the window from errantly growing when scale to display is used
Some compositors will send a configure event immediately after a scale event, however, this event can contain the old logical size, and should be ignored, or the window will incorrectly change size when moved between displays with differing scale factors.

Store the last requested logical size as the last configure size when resizing a floating window due to a scale change, so a configure event immediately following with the old size will be ignored.

(cherry picked from commit 18219d5b53)
2026-03-12 10:23:39 -04:00
Ryan C. Gordon
c5bc4576fc video: Default SDL_GL_FRAMEBUFFER_SRGB_CAPABLE back to zero.
(This was corrected in main, but there isn't a clean cherry-pick we can do for
the release-3.4.x branch at this point, since various pieces of the sRGB work
made it in here in a different order, but this is the one crucial line that
appears to be missing.)

Reference Issue #14898.
2026-03-09 16:47:49 -04:00
Mike Egger
c2a910ab02 windows: support flag RIDEV_INPUTSINK in raw input (#15182)
(cherry picked from commit ae3ae4ba44)
2026-03-08 16:12:03 -07:00
Ozkan Sezer
1e4fd21700 stb_image: Fix -Wdouble-promotion warning
Upstream PR 1902 by Björn Wahlstrand at https://github.com/nothings/stb

(cherry picked from commit 31aa18fc1d)
2026-03-09 00:40:14 +03:00
Frank Praznik
b36a5ab6f4 Log failure reasons during early X11 and Wayland initialization
Log the reason for failure during initialization to the debug log to aid in troubleshooting.

(cherry picked from commit 5880b8a283)
2026-03-03 13:33:11 -05:00
Frank Praznik
aa5bcfa3d8 wayland: Don't add keys with the super/GUI modifier to the keymap
SDL normalizes the super/GUI modifier away, so adding a key with this modifier will overwrite the base, unmodified value.

(cherry picked from commit 8c8efd4ccd)
2026-03-02 18:30:40 -05:00
Sam Lantinga
7a1d02083d Added surface validation to SDL_DuplicateSurface()
(cherry picked from commit 73b13728de)
2026-03-02 09:42:01 -08:00
Petar Popovic
fb9bb7426d Fix memory leak when X11 toolkit window locale SDL_strdup() fails
(cherry picked from commit fb1d1ab306)
2026-03-01 11:44:59 -08:00
Sam Lantinga
3a2a13d966 Loading PNG files are part of the core SDL library
Don't disable this functionality when defining SDL_LEAN_AND_MEAN, but if you need to, you can define SDL_DISABLE_STB if you want to compile this out.

Fixes https://github.com/libsdl-org/SDL/issues/15139

(cherry picked from commit 72d5fe213f)
2026-03-01 11:44:01 -08:00
Sam Lantinga
3e87c31a6c Added surface validation to SDL_ConvertSurfaceRect()
Fixes https://github.com/libsdl-org/SDL/issues/15141

(cherry picked from commit 2d9fca46c6)
2026-03-01 11:35:11 -08:00
Frank Praznik
c608ce5acb x11: Also send key releases when reconciling state
(cherry picked from commit 2f38b6a396)
2026-02-24 17:13:04 -05:00
Brenton Bostick
abab2f1181 make sure #endif comment matches the macro name
(cherry picked from commit a5889b0e44)
2026-02-24 09:49:08 -08:00
Frank Praznik
cbee4abdfc x11: Don't send duplicate key down events when reconciling
Modifier keys shouldn't be repeated.

(cherry picked from commit 550394eecd)
2026-02-23 15:10:17 -05:00
Sam Lantinga
7066c6491e Fixed cursor mask padding calculation
(cherry picked from commit 2e4ac09b1f)
2026-02-23 09:53:12 -08:00
Sam Lantinga
74bfc913ac Improved support for byte array pixel formats
Fixes https://github.com/libsdl-org/SDL/issues/15082

(cherry picked from commit 4f06087b36)
2026-02-21 12:52:12 -08:00
Ethan Lee
a056d0f39a cocoa: Don't include KHR_portability_enumeration by default.
This is only useful if the application knows to add the flag introduced by this
extension, and at that point the application can also include the extension
themselves.

Case in point: SDL_gpu_vulkan was already doing this!
2026-02-20 11:35:43 -05:00
Frank Praznik
267f13446d video: Check video backend initialization when querying the grabbed window
SDL_GetGrabbedWindow() can be called when the video system is uninitialized, and, since there is no window parameter, _this must be checked for validity to avoid a segfault.

(cherry picked from commit be82f316c4)
2026-02-19 11:22:55 -05:00
Ryan C. Gordon
42abf69434 emscripten: Fix only one mouse button being usable at a time.
Fixes #15056.

(cherry picked from commit c9591c515c)
2026-02-17 19:05:18 -05:00
Ryan C. Gordon
5d9d966d59 emscripten: Allow resize events on fullscreen windows.
Fixes browsers on phone that change screen orientation during fullscreen not
getting a resize event.

Fixes #15024.

(cherry picked from commit 0f2d415dee)
2026-02-17 18:41:38 -05:00
Zack Middleton
65dfdce3df win32: Set error for SDL_GL_GetSwapInterval()
(cherry picked from commit 54de246b4b)
2026-02-17 10:27:45 -05:00
Ryan C. Gordon
3a5d0bac71 Revert "MacOS: improve scroll smoothing"
This reverts commit 5dab2c73f0.

We'll revisit this in the next SDL release.

Reference Issue #15058.

(cherry picked from commit 63c0650321)
2026-02-17 10:25:04 -05:00
Cameron Gutman
29c58245a7 android: Fix scancode for AKEYCODE_CHANNEL_DOWN
(cherry picked from commit f0bda7b655)
2026-02-17 00:27:18 -06:00
Sam Lantinga
1faaa128e5 Treat the D-pad center button as SDL_SCANCODE_RETURN
This fixes handling of the Android TV remote select button sent over CEC.

(cherry picked from commit 089f5e1318)
2026-02-16 12:35:34 -08:00
Sam Lantinga
99e1d9595f Moved mouse/keyboard detection to a separate thread on Windows
Getting device names can hang for a long time on certain devices, so make sure this is done on a separate thread to avoid blocking initialization and the main loop.

Fixes https://github.com/libsdl-org/SDL/issues/12913

(cherry picked from commit bc623d1af6)
2026-02-16 11:27:11 -08:00
Sam Lantinga
8389de757a Don't re-query HID device vendor and product
(cherry picked from commit a98e49409e)
2026-02-16 11:27:11 -08:00
Sam Lantinga
a82660bb76 Added temporary workaround hint "SDL_WINDOWS_DETECT_DEVICE_HOTPLUG"
Some devices with broken drivers hang when their name is queried, so added a workaround for applications that don't need input device details. The long term fix is to move the hotplug detection into a separate thread.

(cherry picked from commit a66988621a)
2026-02-16 11:27:11 -08:00
Ryan C. Gordon
ea2b4f4674 hints: Rename SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE.
It's now SDL_HINT_OPENGL_FORCE_SRGB_FRAMEBUFFER, since it does more than mess
with the srgb-capable context attribute now.

Reference Issue #14898.

(cherry picked from commit 10b524c7cc)
2026-02-16 13:09:24 -05:00
Ryan C. Gordon
8f9dd75ead video: Only set GL_FRAMEBUFFER_SRGB state if the hint requests it.
Reference Issue #14898.

(cherry picked from commit ead67481c0)
2026-02-16 13:08:59 -05:00
Cameron Gutman
a849c4d361 win32: Fix composition UI being displayed when IME is disabled
(cherry picked from commit 8535936401)
2026-02-16 09:00:49 -08:00
Ryan C. Gordon
55d78567b1 video: Wrap OpenGL work in ifdefs.
Apparently the rest of SDL_GL_CreateContext compiles on platforms without
OpenGL, though!  :)

(cherry picked from commit 3dc48a4890)
2026-02-09 21:45:42 -05:00
Ryan C. Gordon
88bbc94921 video: Respect SDL_HINT_OPENGL_FORCE_SRGB_CAPABLE with GL_FRAMEBUFFER_SRGB.
Reference Issue #14898.

(cherry picked from commit 9f5747ccd4)
2026-02-09 21:45:22 -05:00
Ryan C. Gordon
027183f89c video: Maybe fix build.
(cherry picked from commit 01689bca0e)
2026-02-09 21:45:10 -05:00
Ryan C. Gordon
0810c5ac0d video: Force GL_FRAMEBUFFER_SRGB state at OpenGL context creation time.
The default varies between OpenGL and OpenGL ES, so try to force it to what
the app actually requested with SDL_GL_FRAMEBUFFER_SRGB_CAPABLE.

Fixes #14898.

(cherry picked from commit 083c6b8872)
2026-02-09 21:45:00 -05:00
Ryan C. Gordon
ae3bb879c7 emscripten: drag-and-drop fixes.
FS.mkdir() will throw a javascript exception if the scratch directory already
exists, so catch/ignore that.

Wrap the rest of the scratch i/o in a try/catch block; the event will only
send if everything works out.

Wrap some calls from Javascript to the C runtime's free() in an
EMSCRIPTEN_KEEPALIVE function, so that the compiler doesn't optimize the
function out and crash at runtime.

Fixes #14999.

(cherry picked from commit 267e681a0b)
2026-02-09 21:43:12 -05:00
Max Seidenstücker
576c2d2f2c Merge all occurances of __func__ and __FUNCTION__ to SDL_FUNCTION
(cherry picked from commit 8f8880a8eb)
2026-02-08 11:56:12 -08:00
Cameron Gutman
48e5fc7b69 cocoa: Fix 1px border in fullscreen on Tahoe
(cherry picked from commit 1d83a35e48)
2026-02-08 11:01:44 -08:00
Frank Praznik
5728f9d703 wayland: Check the mod state when sending repeated key text
The control and alt modifiers should suppress text events when repeating to match standard press behavior.

(cherry picked from commit f07ba5b954)
2026-02-07 14:32:12 -05:00
Jari Vetoniemi
6168085e45 cocoawindow: fix wrong content scale with ANGLE EGL context
ANGLE expects that the surface layer content scale is updated
accordingly.

<b406401e42/src/libANGLE/renderer/metal/SurfaceMtl.mm (L597-L636)>

(cherry picked from commit ef41e0a0f0)
2026-02-06 09:17:17 -08:00