15748 Commits

Author SHA1 Message Date
Semphris
8c8ee2174d Dialog: Add filter number, remove NULL termination 2024-06-03 18:22:26 -07:00
Sam Lantinga
3e70964ae2 Updated docs to note that SDL_GetAudioDeviceName() now returns const char * 2024-06-03 17:42:53 -07:00
Sam Lantinga
1d83b782b8 Set the headphones to 50% volume to avoid blasting people's ears
Also fixed audio routing comments
2024-06-03 17:28:32 -07:00
Sam Lantinga
8aa7910184 Added an example of setting PS5 controller audio routing
Closes https://github.com/libsdl-org/SDL/pull/9661
2024-06-03 17:24:36 -07:00
Sam Lantinga
a9a51cebde Disable raw keyboard input by default
It interferes with keyboard hooks and most applications don't expect key events coming from another thread
2024-06-03 14:43:46 -07:00
Sam Lantinga
73879ef26e Only register for the type of raw input requested by the application 2024-06-03 14:43:46 -07:00
Anonymous Maarten
a919774fe4
Build with -Wfloat-conversion + fix all warnings 2024-06-03 21:33:29 +00:00
SDL Wiki Bot
17c459e384 Sync SDL3 wiki -> header 2024-06-03 18:48:59 +00:00
SDL Wiki Bot
9c4fb449e2 Sync SDL3 wiki -> header 2024-06-03 18:41:23 +00:00
SDL Wiki Bot
de5a8b61d0 Sync SDL3 wiki -> header 2024-06-03 18:27:57 +00:00
SDL Wiki Bot
39c2dacc8f Sync SDL3 wiki -> header 2024-06-03 18:21:49 +00:00
Ryan C. Gordon
e23257307e Introduce formal policy for APIs that return strings.
This declares that any `const char *` returned from SDL is owned by SDL, and
promises to be valid _at least_ until the next time the event queue runs, or
SDL_Quit() is called, even if the thing that owns the string gets destroyed
or changed before then.

This is noted in the headers as "the SDL_GetStringRule", so this will both be
greppable to find a detailed explaination in docs/README-strings.md and
wikiheaders will automatically turn it into a link we can point at the
appropriate documentation.

Fixes #9902.

(and several FIXMEs, both known and yet-undocumented.)
2024-06-03 14:20:49 -04:00
Carlo Bramini
b1f3682216 SDL_assert: add support for aarch64-w64-mingw32
GCC 15 development branch provides an experimental support for Windows on ARM64, which will be officially released next year, according to latest news.
I tried to compile SDL2 with this new compiler but I got a tiny problem into SDL_assert.h because it couldn't find the right platform.
However, it has been easy to fix and I included it into this PR.
More details can be also found here:
https://learn.microsoft.com/en-us/cpp/intrinsics/debugbreak?view=msvc-170

(cherry picked from commit 2cb1a2d0a7f1c9cb3177c907758322899c3041d5)
2024-06-03 10:55:14 -07:00
Sam Lantinga
76e5aa5bfd Log any leaked objects at shutdown 2024-06-03 08:54:46 -07:00
Sam Lantinga
b0e93e4e63 Prevent crashes if freed objects are passed to SDL API functions
Instead of using the magic tag in the object, we'll actually keep track of valid objects

Fixes https://github.com/libsdl-org/SDL/issues/9869
Fixes https://github.com/libsdl-org/SDL/issues/9235
2024-06-03 08:54:46 -07:00
Ryan C. Gordon
57a15933cd SDL_GetCSSCursorName: Don't assert on unrecognized cursor types.
These values are passed through from the calling app and shouldn't trigger
asserts when they are bogus.
2024-06-01 22:32:43 -04:00
Ryan C. Gordon
9a9a3d1a33 SDL_SystemCursor: rename enum items to match CSS.
Fixes #9079.
2024-06-01 22:32:43 -04:00
Ozkan Sezer
49b6c24722 always define PRI?64 using 'I64' when targeting windows
avoids -Wformat warnings from mingw toolchains -- e.g.:
src/test/SDL_test_harness.c:581:37: warning: unknown conversion type character 'l' in format [-Wformat=]
2024-06-01 22:35:40 +03:00
Anonymous Maarten
fd2b9c0602 cmake: don't check c++ compiler flags for asan when CXX is not enabled 2024-06-01 10:18:15 +02:00
Frank Praznik
85a2a201b1
x11: Always disable the borders when leaving fullscreen from a borderless window created as fullscreen
Borderless windows flagged as fullscreen at creation time turn on the borders, because doing so prevents some window managers from wrongly positioning the borderless window, and in these cases the borders need to be removed whether fullscreen is exited programmatically or via a compositor event. Set a flag when forcing the borders on, so they will be removed in all cases later.
2024-05-31 19:11:50 -04:00
Sam Lantinga
4c7459eda8 SDL_cocoawindow: Fix setting parent-relative coordinates for child windows in Cocoa_SetWindowSize 2024-05-31 15:29:19 -07:00
Sam Lantinga
e3beaa1972 Added support for the Razer Kitsune in PS5 mode 2024-05-31 15:18:15 -07:00
Sam Lantinga
cd9c25e800 Don't set the borderless flag if we're about to go fullscreen.
This prevents the GNOME window manager from moving the window to a different display before the window goes fullscreen.

Fixes https://github.com/libsdl-org/SDL/issues/9915
2024-05-31 11:35:18 -07:00
Anonymous Maarten
6896c4c3bf tests: testcases accept a void pointer argument 2024-05-31 19:18:24 +02:00
Anonymous Maarten
d5060423a2 testplatform: fix leak at exit time
A leak was present at exit time on the Emscripten platform
2024-05-31 18:53:36 +02:00
Anonymous Maarten
4b0f52b04e cmake: fall back to per-cpu test when all-in-one test fails
The 'all-in-one' test fails for Emscripten because try_compile does not copy back the actual binary:
the wasm file contains the machine parseable strings, not the html or js file(s).
2024-05-31 18:53:21 +02:00
mechakotik
8f88c32ca6 android: Default to custom theme in styles.xml
Custom theme file exists in project, but is not used by app, which is kinda unintuitive. Using it by default so people who not familiar with Android development won't spend lots of time troubleshooting.
2024-05-31 09:04:06 -07:00
Ozkan Sezer
550d5b95c0 fix type redefinition errors after commit b1b4638cacbe. 2024-05-31 17:47:20 +03:00
Ozkan Sezer
5aa9ee8446 SDL_windowsmodes.c (WIN_GetDisplayNameVista): fix return after PR/9923
why haven't any of the build tests catch this..
2024-05-31 11:33:50 +03:00
Sam Lantinga
90beffdeb1 Revert "WASAPI_WaitDevice: Check current padding before waiting on event"
This reverts commit 09fbb2a07dfca7f3daf4f9c24d5bc0c8ee62cfce.

This was causing issues in CS2 and DOTA:
https://old.reddit.com/r/DotA2/comments/1d4bqe3/dota_2_sound_crackling_since_this_morning/
https://old.reddit.com/r/DotA2/comments/1d44udf/anyone_having_sound_issues_or_any_clue_how_to_fix/
2024-05-30 16:50:30 -07:00
Ozkan Sezer
e4518af377 move vista+ display config function ptr calls to device->driverdata
.. and change hdr code's display config function calls to use those
function ptrs.
2024-05-31 02:50:02 +03:00
Sam Lantinga
fb2287dd47 Fixed updating NV12 and YV12 textures on the direct3d11 renderer
Fixes https://github.com/libsdl-org/SDL/issues/9928
2024-05-30 14:19:34 -07:00
Hunter Kvalevog
8604847214 SDL_SetEventFilter: Don't flush when removing filter
Don't flush the event queue if the filter paramter is NULL.
2024-05-30 13:06:01 -07:00
Hunter Kvalevog
0136bf2f8f SDL_SetEventFilter: Don't flush good events
Only cut events that don't pass the user filter instead of flushing the
entire list.

Fixes #9592
2024-05-30 13:06:01 -07:00
Sam Lantinga
4954690828 Fixed warning C4244: '=': conversion from 'double' to 'float', possible loss of data 2024-05-30 07:44:00 -07:00
Sam Lantinga
690d73f5c9 Fixed warning C4244: 'initializing': conversion from 'WPARAM' to 'Uint32', possible loss of data 2024-05-30 07:42:35 -07:00
Ozkan Sezer
d41e48e4c6 WIN_AdjustWindowRectWithStyle: silence gcc maybe-uninitialized warnings
/tmp/SDL3/src/video/windows/SDL_windowswindow.c: In function 'WIN_SetWindowPositionInternal':
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:216:17: warning: 'h' may be used uninitialized in this function [-Wmaybe-uninitialized]
     rect.bottom = *height;
     ~~~~~~~~~~~~^~~~~~~~~
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:320:12: note: 'h' was declared here
     int w, h;
            ^
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:215:16: warning: 'w' may be used uninitialized in this function [-Wmaybe-uninitialized]
     rect.right = *width;
     ~~~~~~~~~~~^~~~~~~~
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:320:9: note: 'w' was declared here
     int w, h;
         ^
2024-05-29 16:39:03 -07:00
Sam Lantinga
a801f81132 Revert "Fix flickering of window when using desktop-fullscreen and borderless window on multiple monitors on Linux. Closes #8186."
This reverts commit 2de2e9d031cf7195ccdcf434538ea6b742035ca4.

The fullscreen state is no longer available to check, and the actual bug this was trying to work around was fixed in ad813a65e7
2024-05-29 14:15:59 -07:00
Frank Praznik
63c164f778 x11: Use the floating size for the constraints on non-resizable windows
Otherwise, the window manager can think that the window is larger than it is and try to reposition it.
2024-05-29 14:09:29 -07:00
Ozkan Sezer
384e5486bc SDL_windows.h: set _WIN32_WINNT to 0xA00 dxgi1_6.h is available
to make sure DISPLAYCONFIG_SDR_WHITE_LEVEL is visible to us.
2024-05-30 00:05:55 +03:00
Ozkan Sezer
b1c7b2f44f SDL_wasapi.c: avoid unused warning if IAudioClient3 isn't available 2024-05-29 15:43:33 -04:00
Ozkan Sezer
dde9c10e79 SDL_camera_mediafoundation.c: hardcode MF_DEVSOURCE_ATTRIBUTE_* GUIDs 2024-05-29 15:33:42 -04:00
Ramez Ragaa
6bb91c7c08 Support X11 incremental clipboard transfers.
This adds support for pasting large clipboard contents using the INCR
property mechanism

Fixes #8871
2024-05-29 12:30:34 -07:00
Sam Lantinga
652b34bd15 Added SDL_DumpProperties() for internal debugging 2024-05-29 10:30:31 -07:00
Sam Lantinga
ae59afa7d0 Fixed building with ENABLE_SDL_CALL_LOGGING enabled 2024-05-29 10:30:31 -07:00
Frank Praznik
57504385e0 wayland: Maintain aspect ratio while resizing the window
Note that Wayland places a restriction on windows being resized, where the requested size passed to the configuration event is a maximum, and attempting to exceed it is a protocol violation, so trying to grow the window by dragging the sides only vertically or horizontally is limited, as the provided dimensions can't be exceeded.

In practice, nothing seems to kill clients that do this, but the more immediate problem is that doing so causes GNOME to glitch out.
2024-05-29 12:23:36 -04:00
Sam Lantinga
b1b4638cac Add basic vulkan support to offscreen video driver so it doesn't crash if you happen to get the offscreen driver and try to use vulkan.
Enable offscreen video driver in windows to make it easier to test.
Enable offscreen video driver in macos just to complete the desktop computer trio.
2024-05-28 20:02:55 -07:00
SDL Wiki Bot
04a0a85d92 Sync SDL3 wiki -> header 2024-05-29 02:48:51 +00:00
Sam Lantinga
542a3663de Added SDL_GetDefaultKeyFromScancode() to the public API
This is useful when getting the English name of a key for a non-Latin keyboard layout, for example.
2024-05-28 19:48:24 -07:00
Ryan C. Gordon
aeb223fc23
pipewire: if no devices seen in "preferred" init, try a different backend.
We're seeing people with legit PipeWire installs that don't export any
devices, that are also running a (not emulated) PulseAudio install that
works.

This solution might still get tweaked some more, but it seems to be working
so far.
2024-05-28 22:17:40 -04:00