Commit Graph

9480 Commits

Author SHA1 Message Date
Ryan C. Gordon
0f0570b060 pen: Change a Uint32 bitfield into a typedef.
Reference Issue #9812.
2024-05-26 13:23:21 -04:00
Sam Lantinga
534768c7c5 Added SDL_PauseAudioStreamDevice() and SDL_ResumeAudioStreamDevice() 2024-05-26 13:21:23 -04:00
Ryan C. Gordon
2626304e70 properties: add formal SDL_CleanupPropertyCallback type, improve docs. 2024-05-26 12:17:34 -04:00
Frank Praznik
4ee28b6bb4 wayland: Refactor and fix size handling in the configure events
In some cases, size data set programmatically could be overwritten by old configuration data, particularly when on the display scaling path. This refactors the configuration code to be much more strict and verbose regarding the handling of window sizes, which fixes some scenarios where tests were failing when display scaling was activated.
2024-05-26 10:30:46 -04:00
Ryan C. Gordon
033793faed audio: SDL_OpenAudioDeviceStream() now allows a NULL spec. 2024-05-25 23:34:01 -04:00
Frank Praznik
0e1f3b681f video: Distinguish between explicit fullscreen enter requests and update requests
Video backends that run asynchronously can wind up in a race situation if a mode or position update request queues up a fullscreen enter request while an unprocessed asynchronous leave request is in flight, and the mode switch or position update request is processed after the leave request, causing the window to erroneously return to fullscreen.

Instead of the internal SDL_UpdateFullscreenMode and backend SetWindowFullscreen functions taking a boolean value, use an enum that allows the backends to distinguish between "this is an explicit fullscreen enter/leave request", and "this is an update request to change the mode or position". Communicating the specific intent allows the backend to early-out when required, which prevents windows from erroneously returning to fullscreen due to update requests made after a leave request, and allows for the removal of some internal synchronization previously needed to (attempt to) work around this, which improves overall performance while also increasing robustness.

This is only relevant to the internal functions, and nothing in the public-facing API has been changed.
2024-05-25 14:13:00 -04:00
Anonymous Maarten
89a4d9ae67 cmake+d3d12: d3d12 now builds succesfully on older Windows SDKs, so simplify the checks 2024-05-24 21:48:04 +02:00
capehill
318ab9361b opengl: remove duplicated texture format 2024-05-24 12:16:08 -07:00
Anonymous Maarten
98fcf112e7 d3d12: older Windows SDK headers contain wrong function prototypes
Declare correct function pointers ourselves.
2024-05-24 19:39:45 +02:00
Frank Praznik
ecdcf94c5b wayland: Only restore windowed constraints in configuration events
In some cases, the fullscreen deadline handler can be hit before the associated configure event is received, resulting in the constraints being erroneously restored. The state is doubled buffered, so it shouldn't interfere with the pending fullscreen dimensions, but it isn't correct behavior.

According to the spec, calls to set/unset fullscreen will always have an associated configure event, and the constraints will be reapplied as needed there.
2024-05-24 11:01:13 -04:00
Sam Lantinga
836e6c1531 Don't toggle modifier state for repeated keys (thanks @dalawren!)
Closes https://github.com/libsdl-org/SDL/pull/9387
2024-05-24 04:44:56 -07:00
Sam Lantinga
a3ab46b707 Fixed mapping the touchpad for the Qanba PS5 controllers like the Qanba Drone 2 Arcade Joystick
These controllers are autodetected by the HIDAPI driver, so SDL_GetGamepadTypeFromGUID() should be used to pull the gamepad type out of the GUID.
2024-05-23 16:48:04 -07:00
Sam Lantinga
98a9ca5e32 Added Linux bindings for the Qanba Drone 2 Arcade Joystick 2024-05-23 15:34:38 -07:00
Semphris
3acca27e95 Dialog: XDG Portals: Remove the file:// URI 2024-05-23 12:54:39 -07:00
Sam Lantinga
6e081eb7dc Memory leak no more! 2024-05-23 11:26:59 -07:00
Sam Lantinga
156ca356b5 Free any temporary environment memory at SDL_Quit()
Fixes https://github.com/libsdl-org/SDL/issues/9860
2024-05-23 11:23:20 -07:00
Cyao
4022682c28 Fix touchid assertion faliure on emscripten 2024-05-23 10:30:24 -07:00
Frank Praznik
baacbeb4c4 wayland: Make sure the correct cached window dimensions are used when a config size of 0,0 is received
The window may be in a maximized or tiled state, in which case, don't use the floating size.
2024-05-23 11:13:02 -04:00
Frank Praznik
b1061a3ec1 video: Rename 'state_not_floating' to the more descriptive 'tiled' 2024-05-23 10:35:58 -04:00
Frank Praznik
37672f52da wayland: Simplify resize logic
Non-size configuration events are filtered out, so there is no need to enqueue an event when setting the size, as it won't be overwritten in the configure event when only changing state.
2024-05-23 10:35:58 -04:00
Ryan C. Gordon
2f2c3afb05 SDL_internal: tweaked comment. 2024-05-22 20:55:28 -04:00
Ryan C. Gordon
48ebc829e4 thread: Fix build, if SDL is built without an external C runtime.
Fixes #9858.
2024-05-22 20:46:44 -04:00
Ryan C. Gordon
25024ea295 windows: Before SDL_main has run, use WideCharToMultibyte, not SDL_iconv.
Otherwise, this will crash if the app sets its own SDL_malloc allocator, since
SDL_iconv uses SDL_malloc.

WideCharToMultibyte lets us calculate the needed memory for the argv[] string
conversions, and then we use the win32 HeapAlloc() API to get some memory
for it.

Fixes #8967.
2024-05-22 20:08:15 -04:00
Ryan C. Gordon
b83bb035e6 thread: SDL_CreateThreadWithStackSize is now SDL_CreateThreadWithProperties. 2024-05-22 11:39:43 -04:00
Ryan C. Gordon
0ec716819e thread: Reworked SDL_CreateThread to be consistent across platforms.
Also documented missing and weird bits, rename typedefs to fit SDL standards.
2024-05-22 11:39:43 -04:00
Frank Praznik
1f89c407e0 win32: Fix maximized windows when leaving fullscreen
If a window is fullscreen and the maximized state is requested, it needs to be explicitly entered after leaving fullscreen, or the resulting window will be in the maximized state, but still the size of the non-maximized window.
2024-05-21 18:57:55 -04:00
Anonymous Maarten
2123b84fbe SDL_test: add --hide-cursor to help 2024-05-21 22:56:29 +02:00
Dragon-Baroque
05fb91c7b4 TESTWM : Option and Keyboard action to ShowCursor and HideCursor
In include/SDL3/SDL_test_common.h
   Add flag hide_cursor
In src/test/SDL_test_common.c
   Handle option --hide-cursor to SDL_HideCursor
   Handle Ctrl-h toggle to SDL_HideCursor and SDL_ShowCursor
2024-05-21 13:49:35 -07:00
Sam Lantinga
f9260a8470 Added an entry for the 8Bitdo Ultimate Wired Controller 2024-05-20 16:44:45 -07:00
Sam Lantinga
5aecd40683 Try to center windows in the usable bounds if they fit
Fixes https://github.com/libsdl-org/SDL/issues/3480
2024-05-20 15:00:26 -07:00
Ryan C. Gordon
78a36830f8 video: Remove MMX codepath from SDL_BlitCopy.
It was only used if SSE wasn't supported (available since the Pentium III in
1999), or the data was aligned to 8 bytes but not aligned to 16 bytes.

The likelihood of ever hitting this codepath seems extremely low.
2024-05-20 16:37:41 -04:00
Susko3
9d03ff6c18 Decrement before as the code makes more sense 2024-05-20 11:08:19 -07:00
Susko3
9458dc07dc Fix double-free on cleanup and general nonsense when deleting fingers 2024-05-20 11:08:19 -07:00
Frank Praznik
4d32f66fe7 wayland: Don't destroy and recreate the confinement region with window size changes
The spec says that an undefined confinement region should match the input region, so it is resized automatically.

This was a hack for a very old, buggy compositor and is no longer needed.
2024-05-19 10:23:31 -04:00
Frank Praznik
18513d1ce8 wayland: Scale mouse warp coordinates
Fixes warp positioning with scaled windows.
2024-05-18 10:00:53 -04:00
Frank Praznik
b1e01b971b video: Disable mouse warp on fullscreen transitions for Wayland and XWayland
At best, it simply doesn't work, and if it does, it frequently warps the pointer to the wrong position as the window animates in/out of fullscreen mode.

It can also inadvertently trigger the relative warp mode emulation mode on Wayland if a fullscreen transition occurs while the client has the pointer hidden.
2024-05-18 10:00:53 -04:00
Sam Lantinga
6f2621438a Renamed DECLSPEC to SDL_DECLSPEC 2024-05-17 17:09:09 -07:00
Sam Lantinga
2cf32b0e0a Fixed warning: 'fA' may be used uninitialized in this function 2024-05-17 09:42:38 -07:00
APGR22
961488b0dc Added NULL pointer check 2024-05-17 08:54:28 -07:00
Brick
09fbb2a07d WASAPI_WaitDevice: Check current padding before waiting on event
During playback, don't queue another buffer unless there are none in the queue.

During capture, there may be multiple buffers of audio available.
WASAPI_CaptureFromDevice only processes one buffer, and if we always wait on the next event, we will never catch up if it falls behind.
2024-05-17 14:46:20 +01:00
Anonymous Maarten
18225f7bb5 libSDL3_test: don't remove windows and renders when quiting
This fixes a "DEBUG: Parameter 'texture' is invalid" message when exiting testcamera.
2024-05-17 14:39:29 +02:00
Anonymous Maarten
a7d4ee05f6 video: hide window before destroying properties
This fixes a few "DEBUG: Parameter 'props' is invalid" messages, when exiting testcamera.
2024-05-17 14:39:29 +02:00
Brick
b6b9d5508e Renamed SDL_MixAudioFormat to SDL_MixAudio, and use float volume 2024-05-17 13:36:51 +01:00
Sam Lantinga
5c4b558c1c Dynamic API symbol cleanup 2024-05-16 23:18:41 -07:00
Ozkan Sezer
f295f6814c fix type redefinition errors after #9817 2024-05-17 07:28:50 +03:00
Ali Emre Gülcü
f17b556c76 Add SDL_Vulkan_DestroySurface functionality (#9817)
Added SDL_Vulkan_DestroySurface, its documentation and corresponding platform specific implementations. Fixed some header inclusion orders to improve consistency between platforms. Added TODOs regarding MetalView creation and destruction which will benefit from the new functionality.
2024-05-16 17:41:15 -07:00
Sam Lantinga
c24f860c4d Fixed warning C4244: '=': conversion from 'int' to 'Uint8', possible loss of data 2024-05-16 11:28:02 -07:00
Sam Lantinga
abfd0dc683 Added SDL_HINT_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL 2024-05-16 11:23:29 -07:00
Sam Lantinga
730fa2c379 Re-sorted API functions 2024-05-16 10:22:15 -07:00
Sam Lantinga
02ff85f2f3 Renamed SDL_SIMDGetAlignment() to SDL_GetSIMDAlignment() 2024-05-16 10:22:15 -07:00