Log

Author Commit Date CI Message
Jessica Clarke 02daab87 2021-07-29T18:09:38 Fix pointer provenance in SDL_SIMDRealloc This is needed to support CHERI, and thus Arm's experimental Morello prototype, where pointers are implemented using unforgeable capabilities that include bounds and permissions metadata to provide fine-grained spatial and referential memory safety, as well as revocation by sweeping memory to provide heap temporal memory safety. The C standard does not guarantee that if two pointers compare equal they are the same pointer, as C pointers have a notion of provenance, and compilers have been known to exploit this during optimisation. For CHERI, this becomes even more important, as in-place expansion can result in realloc returning a capability to the same address but with increased capability bounds, and so reusing the old capability will trap trying to access outside the bounds of the original allocation. In the case that ptr == mem, memdiff and ptrdiff should still be equal, so the only overhead is a small amount of pointer arithmetic and a store of the new pointer (which is required per the C standard in order to not be undefined behaviour when next loaded). This also fixes the calculation of oldmem to use uintptr_t rather than size_t as casting the pointer to size_t on CHERI will strip the capability metadata, including the validity tag, with the subsequent cast back to void * resulting in a null-derived capability whose validity tag is clear and thus cannot be dereferenced without trapping.
Jessica Clarke 8f38ba4d 2021-07-29T18:02:47 Fix casts that should be using uintptr_t This is needed to support CHERI, and thus Arm's experimental Morello prototype, where pointers are implemented using unforgeable capabilities that include bounds and permissions metadata to provide fine-grained spatial and referential memory safety, as well as revocation by sweeping memory to provide heap temporal memory safety. On most systems (anything with a flat memory hierarchy rather than using segment-based addressing), size_t and uintptr_t are the same type. However, on CHERI, size_t is just an integer offset, whereas uintptr_t is still a capability as described above. Casting a pointer to size_t will strip the metadata and validity tag, and casting from size_t to a pointer will result in a null-derived capability whose validity tag is not set, and thus cannot be dereferenced without faulting. The audio and cursor casts were harmless as they intend to stuff an integer into a pointer, but using uintptr_t is the idiomatic way to do that and silences our compiler warnings (which our build tool makes fatal by default as they often indicate real problems). The iconv and egl casts were true positives as SDL_iconv_t and iconv_t are pointer types, as is NativeDisplayType on most OSes, so this would have trapped at run time when using the round-tripped pointers. The gles2 casts were also harmless; the OpenGL API defines this argument to be a pointer type (and uses the argument name "pointer"), but it in fact represents an integer offset, so like audio and cursor the additional idiomatic cast is needed to silence the warning.
Jessica Clarke c8b4edf3 2021-07-29T17:53:10 Fix SDL_Event definition to support systems with pointers larger than 8 bytes This is needed to support CHERI, and thus Arm's experimental Morello prototype, where pointers are implemented using unforgeable capabilities that include bounds and permissions metadata to provide fine-grained spatial and referential memory safety, as well as revocation by sweeping memory to provide heap temporal memory safety.
Sam Lantinga 9d457aa4 2021-07-29T14:24:40 Don't uninitialize COM because of what appears to be a bug in Microsoft WGI reference counting. This fixes https://github.com/libsdl-org/SDL/issues/4488
Sam Lantinga b3a0174b 2021-07-29T14:23:15 Scale the values correctly based on the sensor type (thanks @meyraud705)
Sam Lantinga 65ff00ec 2021-07-29T14:18:54 Query the rate for the correct sensor (thanks @meyraud705)
SDL Wiki Bot 72ee0ccd 2021-07-29T13:46:05 Sync wiki -> header
Sam Lantinga a186a503 2021-07-29T06:43:39 Added SDL_GameControllerGetSensorDataRate() to get the sensor update rate for a controller.
Sam Lantinga ce8261dd 2021-07-29T06:36:20 Only pump events once per frame and process all currently pending events If you continually poll for events it's possible that new events can come in while you're still processing the last one, delaying rendering. This is more likely with high update rate sensors.
Brick 53987e9b 2021-07-28T21:03:42 Optimized SDL_Convert51ToStereo_AVX
Sam Lantinga 8e35ff5c 2021-07-28T14:20:29 By default minimize real fullscreen windows when they lose focus so the desktop video mode is restored. This fixes https://github.com/libsdl-org/SDL/issues/4039
Aaron Plattner 1e07dba0 2021-06-09T15:26:38 x11: Use glXChooseFBConfig when available in X11_GL_GetVisual When choosing an X11 Visual for a window based on its GLX capabilities, first try glXChooseFBConfig (if available) before falling back to glXChooseVisual. This normally does not make a difference because most GLX drivers create a Visual for every GLXFBConfig, exposing all of the same capabilities. For GLX render offload configurations (also know as "PRIME") where one GPU is providing GLX rendering support for windows on an X screen running on a different GPU, the GPU doing the offloading needs to use the Visuals that were created by the host GPU's driver rather than being able to add its own. This means that there may be fewer Visuals available for all of the GLXFBConfigs the guest driver wants to expose. In order to handle that situation, the NVIDIA GLX driver creates many GLXFBConfigs that map to the same Visual when running in a render offload configuration. This can result in a glXChooseVisual request failing to find a supported Visual when there is a GLXFBConfig for that configuration that would have worked. For example, when the game "Unnamed SDVX Clone" [1] tries to create a configuration with multisample, glXChooseVisual fails because the Visual assigned to the multisample GLXFBConfigs is shared with the GLXFBConfigs without multisample. Avoid this problem by using glXChooseFBConfig, when available, to find a GLXFBConfig with the requested capabilities and then using glXGetVisualFromFBConfig to find the corresponding X11 Visual. This allows the game to run, although it doesn't make me any better at actually playing it... Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Fixes: https://forums.developer.nvidia.com/t/prime-run-cannot-create-window-x-glxcreatecontext/180214 [1] https://github.com/Drewol/unnamed-sdvx-clone
Ozkan Sezer cf85710c 2021-07-28T22:55:10 SDL_audiocvt.c: disable AVX for clang < 5 and gcc < 4.9 See: https://github.com/libsdl-org/SDL/issues/4533
Ryan C. Gordon cc4ab101 2021-07-28T14:37:33 windows: convert "//" comment to "/**/", add a FIXME. Reference #4129 Reference #4177
Adam a2031948 2021-07-28T14:06:51 Added in a MIME-type to the X11 clipboard. (#4385)
SDL Wiki Bot 5346cf84 2021-07-28T17:13:05 Sync wiki -> header
Ethan Lee ad310d39 2021-07-28T12:31:25 wayland: libdecor support for SetWindowModalFor
Ethan Lee 93976ade 2021-07-28T12:22:09 wayland: libdecor support for GetWindowWMInfo
SDL Wiki Bot 46919b1e 2021-07-28T16:11:06 Sync wiki -> header
David Gow 1fb4429b 2021-07-28T21:50:48 wayland: Avoid a pointer→TouchID cast warning As of [1], SDL now compiles with a warning in SDL_waylandevents.c on 32-bit systems under gcc 10.3.0: /tmp/SDL/src/video/wayland/SDL_waylandevents.c: In function 'seat_handle_capabilities': /tmp/SDL/src/video/wayland/SDL_waylandevents.c:958:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 958 | SDL_AddTouch((SDL_TouchID)seat, SDL_TOUCH_DEVICE_DIRECT, "wayland_touch"); | ^ /tmp/SDL/src/video/wayland/SDL_waylandevents.c:964:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 964 | SDL_DelTouch((SDL_TouchID)seat); | ^ This is due to SDL_TouchID always being 32-bit, but seat being a pointer which is (obviously) only 32-bit on 32-bit systems. The conversion is therefore harmless, so silence it with an extra cast via intptr_t. This is what the cocoa backend does (and is similar to what the Win32 backend does, except with size_t). Fixes: 03c19efbd1 ("Added support for multiple seats with touch input on Wayland") [1]: https://github.com/libsdl-org/SDL/commit/03c19efbd17f72f70ee021de6d2549eb0be3bb56
Ozkan Sezer 4a7799be 2021-07-28T17:01:02 --disable-wayland-shared implies --disable-libdecor-shared for now. C.f.: https://github.com/libsdl-org/SDL/issues/4543
David Gow 18303c92 2021-07-28T18:06:34 Wayland: Fix building with --disable-wayland-shared with libdecor. When wayland is not dynamically loaded (--enable-wayland-shared=no) libdecor.h is not included unless SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC is set, so it fails to build. We can't simply move the libdecor.h include above the #ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC block, as libdecor.h itself #includes wayland headers we need to replace with #defines. Instead, duplicate the #include. Fixes https://github.com/libsdl-org/SDL/issues/4543 Note that this doesn't fix any of the underlying issues of libdecor being treated as part of wayland, it just fixes the build. A better solution would probably be to decouple the wayland dynamic loading from the libdecor dynamic loading completely, though that is a lot more work...
David Gow 21cba924 2021-07-28T16:54:23 wayland: Don't create zxdg toplevel decoration twice Each window can have at most one zxdg toplevel decoration, but as of [1], we accidentally create two. (If libdecor is not in use). This causes wayland windows with server-side decorations (e.g. on KDE/KWin) to crash with the message: zxdg_decoration_manager_v1@7: error 1: decoration has been already constructed This extra zxdg_decoration_manager_v1.get_toplevel_decoration() call was introduced while deprecating wl-shell and xdg-shell-stable[1] support, and possibly was a bad interaction with [2], which moved the decoration creation around. Fixes: 6aae5b44f8 ("Remove wl-shell and xdg-shell-unstable-v6 support (#4323)") [1]: https://github.com/libsdl-org/SDL/pull/4323 [2]: https://github.com/libsdl-org/SDL/pull/4374
Ethan Lee 7b239edb 2021-07-28T01:00:00 wayland: Assign frame_callback on window creation. Fixes a crash when creating and destroying a window without calling SwapWindow.
Sam Lantinga 41e1a236 2021-07-27T16:50:06 Correct the maximized size and position for borderless resizable windows This fixes bug https://github.com/libsdl-org/SDL/issues/4043
Ethan Lee 03185e74 2021-07-27T18:35:00 wayland: Tag/Check wl_output objects as well, fixes crashes when libdecor is in use
Ryan C. Gordon 871c1119 2021-07-27T18:24:09 wayland: handle pending resizes immediately, not on SwapWindow. This was originally a workaround for an old Mesa bug, since fixed, apparently, and causes other problems. Fixes #4326.
Sam Lantinga 51c61d7c 2021-07-27T14:57:18 Run the entire Cocoa messagebox function on the main thread. This fixes bug https://github.com/libsdl-org/SDL/issues/4420
Sam Lantinga dfd3f30e 2021-07-27T14:27:37 Make Cocoa_HandleTitleButtonEvent() static since it's not used anywhere else
Sam Lantinga 14d58dc8 2021-07-27T14:23:40 Fixed the parameter documentation
Ethan Lee a3eb297e 2021-07-27T17:17:19 wayland: Rework enter/leave and update_scale_factor to avoid bogus wl_output data. Also remove get_window_scale_factor() which was just pointless indirection.
Simon Zeni 6aae5b44 2021-07-27T17:12:26 Remove wl-shell and xdg-shell-unstable-v6 support (#4323) * wayland-protocol: update wayland.xml to 1.19.0 * wayland: remove shell_surface field from SDL_SysWMinfo * wayland: remove wl_shell support * waypand-protocols: update xdg-shell.xml to 1.20 * wayland: remove xdg-shell-unstable-v6 support * wayland: deprecate wl shell surface syswm info, add xdg surface
Sam Lantinga 65dc4edb 2021-07-27T12:51:44 Reverted accidental Visual Studio version bump in SDL.sln
Sam Lantinga 88e4755c 2021-07-27T12:43:00 Make sure we don't try to turn on relative mouse mode while clicking on the window title bar. This fixes bug https://github.com/libsdl-org/SDL/issues/4469
Sam Lantinga 7df6a9ea 2021-07-27T10:44:04 Add a test case for bug https://github.com/libsdl-org/SDL/issues/4469
Splamy c72aef26 2021-05-01T23:56:23 Fixed microphone randomly stop working WASAPI_WaitDevice is used for audio playback and capture, but needs to behave slighty different. For playback `GetCurrentPadding` returns the padding which is already queued, so WaitDevice should return when buffer length falls below the buffer threshold (`maxpadding`). For capture `GetCurrentPadding` returns the available data which can be read, so WaitDevice can return as soon as any data is available. In the old implementation WaitDevice could suddenly hang. This is because on many capture devices the buffer (`padding`) wasn't filled fast enough to surpass `maxpadding`. But if at one point (due to unlucky timing) more than maxpadding frames were available, WaitDevice would not return anymore. Issue #3234 is probably related to this.
Ryan C. Gordon 4ef8674d 2021-07-27T14:18:44 Revert "wasapi: Open capture devices the way we used to." This reverts commit 0d0fee7569803ddc41985bfc249418b02dd8cd97.
Ryan C. Gordon 0d0fee75 2021-07-27T14:12:18 wasapi: Open capture devices the way we used to. This should work around the regression in #3234, since it basically reverts the problem change, but only for capture devices. Fixes #3234.
Sam Lantinga b2d77e63 2021-07-27T10:57:40 Added testwm2 to the Visual Studio test programs
Ryan C. Gordon f4eb7f32 2021-07-27T13:45:33 spinlock: Favor gcc-style atomics over MSVC interfaces. This resolves a problem when using Clang on Windows. Fixes #4346.
Ozkan Sezer 9bcb5e7b 2021-07-27T20:20:28 configure: move CheckLibDecor into CheckWayland
Ryan C. Gordon 736a424f 2021-07-27T13:12:57 pulseaudio: Optionally add "monitor" sources to device list. There's a new hint to enable this. Fixes #2917.
Ryan C. Gordon 8d790b10 2021-07-27T12:23:46 audiocvt: stereo-to-mono SSE3 now uses unaligned accesses. On modern CPUs, there's no penalty for using the unaligned instruction on aligned memory, but now it can vectorize unaligned data too, which even if it's not optimal, is still going to be faster than the scalar fallback. Fixes #4532.
Sam Lantinga a894ce4c 2021-07-27T08:34:46 Include README.md in the distribution archive
Ozkan Sezer e16fb603 2021-07-27T17:10:24 tweak HAVE_IMMINTRIN_H in SDL_config_windows.h, add to SDL_config_macosx.h
Sam Lantinga 2a53f831 2021-07-26T23:29:20 Fixed controllers showing up under both MFI and HIDAPI drivers The Game Controller Kit doesn't show the controllers at startup, so the HIDAPI driver sees them first and therefore gets preference when a controller is supported by both drivers. This fixes bug https://github.com/libsdl-org/SDL/issues/4209
Sam Lantinga 46869db0 2021-07-26T23:27:13 Fixed controller rumble on macOS Needed to add a strong reference to the haptics engine
SDL Wiki Bot e94d4b8c 2021-07-27T00:08:05 Sync wiki -> header
Sam Lantinga a850fec7 2021-07-26T15:05:02 Added missing mapping for the Xbox Elite Controller on Linux This fixes https://github.com/ValveSoftware/steam-for-linux/issues/7826
Ozkan Sezer d80ef3e5 2021-07-26T22:51:24 SDL_VideoInit: silence 'may be used uninitialized' warning src/video/SDL_video.c:475: warning: 'i' may be used uninitialized in this function
Luis Cáceres 45de0a1d 2021-04-02T06:28:10 Support comma-separated lists in SDL_AUDIODRIVER
Luis Cáceres 5ec69285 2021-04-02T06:16:09 Support comma-separated lists in SDL_VIDEODRIVER
Sam Lantinga ba8bc143 2021-07-26T12:09:33 Sort joystick entries in /dev/input This fixes https://github.com/libsdl-org/SDL/issues/4430
Sam Lantinga 8d527def 2021-07-26T10:18:18 Revert "hidapi_switch: Implement HD rumble effect (#4538)" This reverts commit 19082b115b8ba3fff93e1c317c380718086a509c, which broke rumble on the Nintendo Switch Pro controller
Narr the Reg 19082b11 2021-07-26T12:00:53 hidapi_switch: Implement HD rumble effect (#4538)
Ozkan Sezer 3b7649c5 2021-07-26T01:29:10 regenerated configure
Christian Rauch ac904b8e 2021-06-21T01:25:25 wayland: ignore resize in fullscreen or maximised mode
Christian Rauch ee062c64 2021-05-19T00:13:39 wayland: implement toggling decorations
Christian Rauch 2b3cf36f 2021-05-22T00:49:10 wayland: forward window events
Christian Rauch 48066984 2021-04-05T14:09:03 wayland: enable/disable ACTION_RESIZE for fullscreen
Christian Rauch 9e6fcbe7 2020-06-11T22:10:28 wayland: client-side decoration
Christian Rauch f4f9c6bc 2021-03-11T00:40:43 CI: add 'libdecor' dependency from upstream
Christian Rauch e5f9fae0 2021-05-16T23:19:45 wayland: don't flush after setting fullscreen
kenmays c0601d01 2021-07-25T10:15:03 SDL: Updated patches for HAIKU
kenmays 761d3837 2021-07-25T10:14:26 SDL: Updated patches for HAIKU
Mathieu Eyraud 8e604a5f 2021-07-25T18:44:33 Fix error handling in X11_SetWindowTitle X11_XChangeProperty return 1 on success.
Jaylon Gowie bc3b98f3 2021-07-25T03:33:44 Replace with SDL_SendKeyboardKeyAutoRelease
Jaylon Gowie 5cd37c0a 2021-07-25T01:04:51 Add Enter Key support to PSVita IME keyboard
Sam Lantinga 10ec4c86 2021-07-24T22:11:22 Added support for the PowerA Nintendo Switch Spectra Controller
Sam Lantinga 3c9559f7 2021-07-24T19:43:56 Don't try to rumble third-party Nintendo Switch Pro controllers Sending rumble to the PowerA Spectra Nintendo Switch controller hangs input reports for a couple of seconds.
Sam Lantinga cc19b13b 2021-07-24T19:21:29 Fixed missing return statement
Cameron Cawley 89bdc6ba 2021-07-24T13:57:59 Fix MSVC builds in paths with spaces
Cameron Cawley b0daa9f1 2021-07-24T13:33:54 Automatically select the default platform toolset for MSVC builds
Sam Lantinga d4ac6b5e 2021-07-24T15:58:33 Detect buffer overflow when getting DirectInput device state This fixes bug https://github.com/libsdl-org/SDL/issues/4528
Sam Lantinga 3b85e3fd 2021-07-24T15:47:11 Fixed internal Windows key state when using Windows+Space or Windows+G shortcuts This fixes bugs: https://github.com/libsdl-org/SDL/issues/4369 https://github.com/libsdl-org/SDL/issues/4500
Sam Lantinga 03c19efb 2021-07-24T15:25:50 Added support for multiple seats with touch input on Wayland This fixes bug https://github.com/libsdl-org/SDL/issues/4517
Sam Lantinga ff1b5e1b 2021-07-24T15:10:57 Implemented the window flash operations for X11
Ryan C. Gordon 5ae0dd4b 2021-07-24T17:44:35 joystick: Split out Linux opening code for reuse by querying code. This prevents an assertion whem LINUX_JoystickGetGamepadMapping tried to open the stick temporarily and messed with global state by doing so. Now the global state is only set in LINUX_JoystickOpen, but the common code is shared by both interfaces. Fixes #4198.
Cameron Cawley 6c92bf54 2021-07-24T15:34:53 Add more filters to the MSVC project
Sam Lantinga f1633127 2021-07-24T13:41:55 Added a window flash operation to be explicit about window flash behavior
Joel Linn b2c8d3e9 2021-06-11T22:14:54 audiocvt: 5.1 to Stereo conversion utilizing AVX
Joel Linn 20eea021 2021-06-12T01:25:40 Windows: set HAVE_IMMINTRIN_H for AVX intrinsics
Joel Linn 638befc1 2021-06-10T17:22:39 audiocvt: 5.1 to Stereo conversion utilizing SSE
Joel Linn db56526f 2021-06-10T13:07:27 audiocvt: Replace divisions Division is expensive and the compiler can not replace it themselves. Though we now we will be ok in terms of floating point edge behaviour.
Sam Lantinga e1c3a250 2021-07-24T12:11:27 Changed SDL_FlashWindow() so it doesn't take a flash count, and added the hint SDL_HINT_WINDOW_FLASH_COUNT to control behavior on Windows
Sam Lantinga 09d1cea7 2021-07-24T11:15:09 Use the new controller type for the Luna and Stadia controllers
Sam Lantinga 2147e7bf 2021-07-24T11:01:58 Sorted the hints alphabetically
Sam Lantinga 808c3ae6 2021-07-24T10:36:56 Allow mapping Android controllers that just have a D-PAD and face buttons This fixes bug https://github.com/libsdl-org/SDL/issues/4327
SDL Wiki Bot 856c87fc 2021-07-24T17:32:05 Sync wiki -> header
Sam Lantinga d89f4b3a 2021-07-24T10:29:34 Note that mouse warping doesn't work over Microsoft Remote Desktop Fixes the documentation portion of bug https://github.com/libsdl-org/SDL/issues/4206
Sam Lantinga 94b7a876 2021-07-24T09:10:18 Added SDL_GameControllerType enumerations for the Amazon Luna and Google Stadia controllers Fixes bug https://github.com/libsdl-org/SDL/issues/4019
Ryan C. Gordon 6956f4aa 2021-07-24T11:06:40 cmake: use CMAKE_INSTALL_LIBDIR instead of hardcoding "lib", etc. These came from HaikuPorts, specifically this patchset: https://github.com/haikuports/haikuports/blob/462947dd4f285a885d8011cade7cd0f7151cfe74/media-libs/libsdl2/patches/libsdl2-2.0.14.patchset This is just the part that is _not_ Haiku-specific. I wanted this in a separate commit though, since I'm not really a CMake expert; if this causes problems and we need to bisect to it, we won't be confused about it being a Haiku issue when we get here. Fixes #4092. (and probably others.)
Ryan C. Gordon 403afdb5 2021-07-24T11:02:27 cmake: Haiku fixes. These came from HaikuPorts, specifically this patchset: https://github.com/haikuports/haikuports/blob/462947dd4f285a885d8011cade7cd0f7151cfe74/media-libs/libsdl2/patches/libsdl2-2.0.14.patchset This is just the Haiku-specific bits; the more general parts about install dirs will be split into a different commit here. Reference issue #4092.
Sam Lantinga 7d8f34cb 2021-07-24T01:19:58 Updated .gitignore from @Zangetsu38 - thanks!
german77 e6e8fe6d 2021-07-23T10:45:03 hidapi_switch: Implement analog rumble
Sam Lantinga 669714ca 2021-07-23T23:51:35 Added the ThrustMaster T.16000M as a flightstick
Sam Lantinga 384d86b5 2021-07-23T23:48:23 Fixed compile warnings with Visual Studio
Sam Lantinga adb75d64 2021-07-23T23:45:18 Fixed hotplug detection not working on UWP or when SDL isn't pumping Windows events This fixes bugs: https://github.com/libsdl-org/SDL/issues/4321 https://github.com/libsdl-org/SDL/issues/4147 Thanks to DJm00n for the suggestion!
Sebastian Krzyszkowiak 7b0092db 2021-07-23T18:58:25 vita: touch: Mark the back panel as an indirect absolute touch device It's not a touchscreen, but an additional touch panel on the back of the device.
Sam Lantinga 422b053b 2021-07-23T16:32:35 Added support for the full line of current PowerA Xbox Series X controllers