Commit Graph

21601 Commits

Author SHA1 Message Date
sunshineinabox
6b060435e3 egl: Handle error when binding EGL API in context creation 2026-03-18 13:47:27 -04:00
Petar Popovic
55fa5e0336 SDL_dynapi.c: Unload other SDL library if initializing the jumptable fails 2026-03-18 12:49:09 -04:00
Andrei Alexeyev
ff543723c4 Fix SDL_HINT_OPENGL_ES_DRIVER interaction with SDL_HINT_OPENGL_LIBRARY for x11 and windows
If SDL_HINT_OPENGL_ES_DRIVER is enabled and a GLES context is requested,
don't try to load the WGL/GLX library. Doing so may fail, because
SDL_HINT_OPENGL_LIBRARY may have been set to a custom libGLESv2 (e.g.
ANGLE). This effectively restores the SDL2 behavior.

Other video drivers shouldn't be affected, because they always use EGL
for GLES.

Incidentally, this patch also fixes a missing GL_GetEGLSurface callback
in the X11 fallback path.
2026-03-18 12:44:48 -04:00
Frank Praznik
62af66f14a x11: More XInput2 #define cleanups
Fixes building on very old XInput2 versions (pre-2012) without smooth scrolling and multitouch.
2026-03-18 11:25:07 -04:00
Sam Lantinga
b9c227e07d Make changing raw input mode on Windows a very fast operation (take 2)
The first approach had the drawback that it accumulated handles while raw input was paused, eventually crashing the application.

Now we'll keep reading raw events from the queue, we just won't deliver them to  the application.
2026-03-17 12:56:23 -07:00
Frank Praznik
d88f76caac x11: Fix building when XInput2 is not available 2026-03-17 15:31:48 -04:00
Sam Lantinga
c717a20ec8 Fixed initial window size and placement on visionOS 2026-03-17 12:25:13 -07:00
Frank Praznik
3d21b3bc68 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.
2026-03-17 13:24:32 -04:00
Sam Lantinga
75dead7f96 Minor cleanup 2026-03-17 09:49:15 -07:00
Sanjay Govind
fdc5efe1cb add vids and pids for a variety of xbox 360 devices (#15211)
Added vids for a variety of xbox 360 devices, mostly for linux use.
Corrected wheel vid and pid being flagged as unknown. Internally, when XUSB is building vid and pids for wireless devices, it assigns 0x02a1 for devices with subtype 1 and 0x02a2 for devices with subtype 2, which are wheels.

Some of these vids and pids do rely on the following patch being merged into the linux kernel, as I have overhauled how VID and PIDs are handled there for wireless devices.
https://patchwork.kernel.org/project/linux-input/patch/20260314075034.1488655-2-sanjay.govind9@gmail.com/

Also added some lists for guitar and drum devices, so we can set controller types correctly for those controllers.
2026-03-17 09:45:26 -07:00
Sam Lantinga
43e90c7b1c Make changing raw input mode on Windows a very fast operation
Previously we would spin up and shut down a thread every time we changed raw input mode, which can take several ms. Now we'll just put the raw input thread to sleep when disabling raw input and wake it up when enabling raw input.
2026-03-16 17:19:47 -07:00
Sam Lantinga
fbc49daab7 Clarified SDL_EVENT_WINDOW_ICCPROF_CHANGED documentation (thanks @JacksonAllan!) 2026-03-16 17:14:44 -07:00
Steel
32cf5fe93d Add support for PXN VD6 Wheelbase 2026-03-16 10:51:06 -07:00
Sam Lantinga
1d081314a8 Fixed error when SDL_LoadSurface_IO() is passed a NULL src 2026-03-15 13:17:11 -07:00
Cameron Gutman
5f92aac095 windows: Fix Print Screen key capture during keyboard grab 2026-03-15 15:12:29 -05:00
Frank Praznik
8d55fbe4d2 wayland: Fix the state check when resizing a hidden window
The floating state is only set after the first configuration event arrives, so size changes before the window was initially shown could be dropped. Use the flags instead.
2026-03-15 16:03:52 -04:00
SDL Wiki Bot
5f78ded319 Sync SDL3 wiki -> header
[ci skip]
2026-03-15 10:59:52 +00:00
Sam Lantinga
46f35e6ea2 Add a necessary step for iOS app setup in Xcode 2026-03-15 01:54:28 -07:00
SDL Wiki Bot
8bf3b7215a Sync SDL3 wiki -> header
[ci skip]
2026-03-14 18:58:22 +00:00
Frank Praznik
566448d95a 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.
2026-03-13 22:42:09 -04:00
Sam Lantinga
69e94a4fbd Fixed warning: no previous prototype for function 'SDL_IsJoystickGameInput' 2026-03-13 17:23:54 -07:00
Rachel Blackman
ba00e772a7 Add second-gen Backbone One to recognized controllers. 2026-03-13 15:39:15 -07:00
Frank Praznik
41bce956f0 wayland: Send display moved events on display geometry changes
Updates are sent to outputs, however, dispatching the moved event was overlooked and never implemented.
2026-03-13 13:52:02 -04:00
Frank Praznik
98d23660bc wayland: Prevent overlapping outputs when using display scaling
When using the display scaling mode, scaled outputs would overlap, as the origins are in scaled points, while the width and height are in pixels. Use a simple algorithm to push the overlapping rectangles apart, so they do not overlap. This may end up leaving gaps in complex layouts (which are already somewhat mangled from mixing coordinate systems), but it works well enough in most cases.
2026-03-13 13:52:02 -04:00
Ryan C. Gordon
9f19cffc78 io: With stdio, only forbid opening directories as files.
This allows opening Unix device nodes, etc.

Fixes #15188.
2026-03-12 12:41:34 -04:00
Ryan C. Gordon
4d675f2bd3 io: Wrap IsRegularFileOrPipe in a more generic preprocessor test.
This way we can turn it off for various console platforms without changes
to this file.
2026-03-12 12:41:34 -04:00
Ryan C. Gordon
803cd7589a io: Remove iodata->regular_file check.
It wasn't used, and causes an extra fstat().
2026-03-12 12:41:34 -04:00
Sam Lantinga
11adfd2008 Disable system gesture state for all GCControllers
Technically we only want to do this for controllers that are opened, but we don't have a way to match up controllers using other APIs with individual GCControllers.
2026-03-12 08:34:34 -07:00
Sam Lantinga
b80b466423 Removed redundant ifdef 2026-03-12 08:29:47 -07:00
Frank Praznik
18219d5b53 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.
2026-03-12 10:19:22 -04:00
WillyJL
c45be94938 Fix strpbrk() discarded const qualifier 2026-03-10 14:25:28 -07:00
Evan Hemsley
b4b9a037b6 GPU: Refcount Vulkan allocations to fix transfer corruption on defrag (#15127)
Merging, this can be cherry-picked as well.
2026-03-10 13:33:07 -07:00
Nintorch
419dcfe747 Fallback for non-gamepad controllers in GameInput
This PR makes the GameInput joystick backend ignore non-gamepad controllers if DirectInput or XInput backends are enabled. This is done to prevent possible bugs and/or regressions.
2026-03-10 11:06:10 -07:00
SDL Wiki Bot
d20c7e537d Sync SDL3 wiki -> header
[ci skip]
2026-03-10 12:43:12 +00:00
SDL Wiki Bot
6ccf3d097e Sync SDL3 wiki -> header
[ci skip]
2026-03-09 20:14:48 +00:00
Nintorch
0138843eb7 Small GameInput joystick backend improvements
This PR includes small improvements to the GameInput joystick backend:
- Device subtypes
- Compatibility with DirectInput joystick mappings (if the controller is not a gamepad, i.e. `GAMEINPUT_InternalIsGamepad()` returns `false`)
- Fallback to DirectInput/XInput for currently unsupported devices (force feedback ones and the ones that are neither gamepads nor controllers, I'm not sure if that's possible, but maybe racing wheels and other device subtypes would count?)
2026-03-09 11:12:00 -07:00
Sam Lantinga
25b62f01ed Don't load libopenxr_loader.so
We are locked to version 1 of the ABI, so don't load what might be a symlink to a newer and incompatible version.

Platforms like OpenBSD that only have .so versions of libraries can add a special case here like Android in the future.

Fixes https://github.com/libsdl-org/SDL/issues/15172
2026-03-09 09:59:02 -07:00
Sanjay Govind
101273f429 extract capabilities for 360 controllers over libusb (#15183)
Read capabilities when using xinput controllers via the libusb backend

This gives us access to the subtype on linux and macOS, and gives us a lot of data we can use for handling more detailed device types when I look into a unified api for exposing instrument data later.
2026-03-08 17:29:56 -07:00
SDL Wiki Bot
466ab45722 Sync SDL3 wiki -> header
[ci skip]
2026-03-08 23:13:12 +00:00
Mike Egger
ae3ae4ba44 windows: support flag RIDEV_INPUTSINK in raw input (#15182) 2026-03-08 16:11:33 -07:00
Ozkan Sezer
31aa18fc1d stb_image: Fix -Wdouble-promotion warning
Upstream PR 1902 by Björn Wahlstrand at https://github.com/nothings/stb
2026-03-09 00:39:50 +03:00
Sanjay Govind
e610b85d1c support batteries on 3rd party controllers 2026-03-08 11:40:35 -07:00
Sanjay Govind
94f17d6c61 Add support for whammy and tilt on PS4/5 guitars
PS4/5 controllers put device specific data into a specific region in the report, so we have to extract it separately.

No known guitars use the right stick on the guitar, so to keep things working similarly to PS3, i have opted to map whammy and tilt the same way as the PS3 rb guitars.
2026-03-08 11:35:57 -07:00
SDL Wiki Bot
b3f4ebad28 Sync SDL3 wiki -> header
[ci skip]
2026-03-08 14:38:51 +00:00
Petar Popovic
67ac0e5eee SDL_InternalGlobDirectory(): set string length of base directory to 1, if it's just one slash 2026-03-07 12:43:56 -05:00
Petar Popovic
93e3e8a5fe SDL_InternalGlobDirectory(): keep track of pathlen and reuse it, instead of calling SDL_strlen(path) 2026-03-07 12:43:56 -05:00
Petar Popovic
961a04fa26 SDL_GlobDirectory(): Don't chop off first slash from path, if it's just multiple slashes 2026-03-07 12:43:56 -05:00
SDL Wiki Bot
d0a7290689 Sync SDL3 wiki -> header
[ci skip]
2026-03-07 16:20:37 +00:00
Caleb Cornett
12a435e11d gdk: Update Suspend/Resume best practices.
Updated testgdk to demonstrate correct handling of suspend/resume and the new Render APIs, and updated the docs to explain the correct usage of these GDK functions.
2026-03-07 11:19:09 -05:00
Ethan Lee
ee5c5cf755 render: Add Suspend/Resume calls for GDK support 2026-03-07 11:19:09 -05:00