src/core


Log

Author Commit Date CI Message
Weng Xuetian 2eb73e24 2023-07-20T12:04:01 Remove the unimplemented CloseIC in fcitx module This call is actually a left-over when porting from fcitx4 service to the new org.freedesktop.portal.Fcitx supported by both fcitx4/fcitx5. CloseIC is actually never a part of the new interface on org.freedesktop.portal.Fcitx. It cause any issue user visible effect.
Christopher Wellons 078e817c 2023-07-09T20:05:32 Unaligned stacks on i686-w64-mingw32, may lead to crashes (#7607) Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>(cherry picked from commit 8231278817faabdff4a232770f798684bd2e12df)
Simon McVittie 4ce5c3a6 2023-06-20T13:22:55 ibus: Handle error when getting the D-Bus machine ID It is possible for retrieving the machine ID to fail, either because dbus was installed incorrectly (machine ID absent or corrupt), or in 32-bit builds, because stat() on the machine ID fails with EOVERFLOW if it has an out-of-range timestamp or inode number. dbus has historically treated this as a faulty installation, raising a warning which by default causes the process to crash. Unfortunately, dbus_get_local_machine_id() never had a way to report errors, so it has no alternative for that (bad) error handling. In dbus >= 1.12.0, we can use dbus_try_get_local_machine_id() to get the same information, but with the ability to cope gracefully with errors. ibus won't work in this situation, but that's better than crashing. (cherry picked from commit 91198baed40d5709020c3001e9234f4580df696a) Mitigates: https://github.com/ValveSoftware/steam-for-linux/issues/9605 Signed-off-by: Simon McVittie <smcv@collabora.com>
Anonymous Maarten d6cd4506 2023-05-27T02:34:41 windows: SDL_Delay expects a 32-bit integer
Anonymous Maarten e8757759 2023-05-27T02:10:18 windows: SDL_immdevice needs SDL_timer.h include
Ryan C. Gordon 48e71ae8 2023-05-26T19:08:24 wasapi: Deal with HDMI or DisplayPort-based audio devices. They can vanish for UP TO EIGHT SECONDS...! This is for devices that connect to HDMI/DisplayPort/etc, where it presumably has to wait for a display to get up and running before it can play audio through it, so one can see the audio device fail when changing display modes, or the system returning from sleep. Since this can be triggered by a game changing video resolutions at startup (either before or after opening the audio device!), it's important to deal with. In normal conditions, it shouldn't take this long to open or recover an audio device, but this is better than unexpectedly losing the device in this situation. Fixes #7044. Fixes #5571.
Sam Lantinga 3f1fd5ab 2023-05-23T10:59:03 Updated source to match SDL function prototype style
Caleb Cornett 2001a891 2023-05-20T13:09:46 Fix Xbox link error from IsRectEmpty (cherry picked from commit 376a3cd100a3d59e887496c75a1ac49ab4a2d8ec)
Sam Lantinga 57043825 2023-04-04T12:33:41 Fixed crash if dbus can't be initialized (cherry picked from commit cf2c6fa58dea02edb870cff7090fd69f3dfbd081)
Bartłomiej Dach b970dd1b 2023-03-25T20:52:15 Android: Fix mismatching JNI method signature Another regression from commit dca3fd8307c2c9ebda8d8ea623bbbf19649f5e22, which was a backport of commit de3909a190f6e1a3f11776ce42927f99b0381675 from SDL3 to SDL2. This time the regression is much less apparent, however, due to two reasons: - It only appears when the SDL project is ran on an actual device due to magic stringage. - More importantly, the regression was partially hidden due to the nature of de3909a190f6e1a3f11776ce42927f99b0381675. The commit which was backported added a single `I` to the JNI method signature in `SDL_android.c`, representing the added `int axis_mask` parameter. The parameter was added to both SDL2 and SDL3. However, notably, that `I` was added *after* commit fcafe40948fe308cc9552df5a3d625ee2725de5a, which removed the `int nballs` parameter from the joystick API, but only from the SDL3 branch. Therefore, in totality, what should really have been a merge conflict, was obscured by the fact that the SDL3 branch ended up having a net-identical JNI signature to the SDL2 branch, due to having one bool param removed and one added - while, in fact, the SDL2 branch needed one bool param added and none removed.
Rudolf Polzer dca3fd83 2023-03-11T12:02:17 Android: indicate gamepaddb entries where axis order changed. Axis order was changed in 6f1f586086a18ab32ddccc05e4616aac02774a1b to improve default mappings. (cherry picked from commit de3909a190f6e1a3f11776ce42927f99b0381675)
Sam Lantinga 0d763800 2023-03-09T15:10:00 Code style: changed "sizeof foo" to "sizeof(foo)" (thanks @sezero!) (cherry picked from commit c6443d86c92e962683a1efe5f123a144988875b5)
Michal Suchanek 96a2a6b9 2023-03-03T19:44:11 evdev_kbd: Use current keymap keymap can change over time, caching the keymap causes wrong keys returned when user changes keymap during runtime Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Sylvain d948e6c3 2023-02-15T22:38:57 Fix potential de-referencing null pointer in SDL_EVDEV_kbd_keycode()
Sam Lantinga e7376b7b 2023-02-15T13:53:57 Fixed Steam Runtime sandbox detection Fixes hotplug issues on Steam Deck for Proton and native games (cherry picked from commit bcd97b36d23d08226e98a995eafd3d6aa35401b4)
Sylvain 17515f4a 2023-02-04T15:51:37 Backport simplify flags PR #7220
Sam Lantinga 0479df53 2023-01-09T09:48:21 Updated copyright for 2023
Ozkan Sezer 5b904a10 2022-12-31T08:00:00 windows: more HANDLE -> HMODULE changes.
Maido 311b02f0 2022-12-19T17:02:10 Android active driver check (#6850) Check if a driver is active before attempting to handle the devices. Otherwise an assertion will fail.
Sylvain Becker 36c87d9f 2022-12-18T16:55:59 Android JAVA DetectDevices: 'is_capture' is inverted (#6845) * Android JAVA DetectDevices: 'is_capture' is inversed * Android Audio: adding audio device. also inverted capture, from jni side
Sylvain Becker 4e3fc0c1 2022-12-18T12:07:38 Android: make Detect devices common between aaudio and android driver. (#6828) remove VLA, dynamic alloc, check max length get using GetIntArrayRegion
Maido 741499de 2022-12-16T17:38:57 Android audio device selection (#6824) Make it possible to select a specific audio device for Android
Sylvain Becker 582fb390 2022-12-14T17:41:35 DBus: add a reference to the connection Fixed bug #6712
Pierre Wendling d0bbfdbf 2022-12-01T16:07:03 Clang-Tidy fixes (#6725) (cherry picked from commit 3c501b963dd8f0605a6ce7978882df39ba76f9cd)
Sylvain 09ee811f 2022-12-01T09:39:08 Small format changed (using clang-format 15.0.2-1) (cherry picked from commit 778b8926b4808f0642a331ed84a9e8e19899b6db)
Sam Lantinga b8d85c69 2022-11-30T12:51:59 Update for SDL3 coding style (#6717) I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base. In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted. The script I ran for the src directory is added as build-scripts/clang-format-src.sh This fixes: #6592 #6593 #6594 (cherry picked from commit 5750bcb174300011b91d1de20edb288fcca70f8c)
Sam Lantinga 2d24baaa 2022-11-29T09:26:29 Fixed building on Windows with SDL_VIDEO=OFF Fixes https://github.com/libsdl-org/SDL/issues/6562
Sylvain Becker fb0ce375 2022-11-27T17:38:43 Cleanup add brace (#6545) * Add braces after if conditions * More add braces after if conditions * Add braces after while() conditions * Fix compilation because of macro being modified * Add braces to for loop * Add braces after if/goto * Move comments up * Remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements after merge * Fix inconsistent patterns are xxx == NULL vs !xxx * More "{}" for "if() break;" and "if() continue;" * More "{}" after if() short statement * More "{}" after "if () return;" statement * More fix inconsistent patterns are xxx == NULL vs !xxx * Revert some modificaion on SDL_RLEaccel.c * SDL_RLEaccel: no short statement * Cleanup 'if' where the bracket is in a new line * Cleanup 'while' where the bracket is in a new line * Cleanup 'for' where the bracket is in a new line * Cleanup 'else' where the bracket is in a new line (cherry picked from commit 6a2200823c66e53bd3cda4a25f0206b834392652 to reduce conflicts merging between SDL2 and SDL3)
Ciro Mondueri f6144dfe 2022-11-23T16:41:14 adds GDK suspend/resume basic handling (#6596)
Sam Lantinga 8b20b568 2022-11-21T07:41:35 Don't report battery level for disconnected batteries Fixes https://github.com/libsdl-org/SDL/issues/6536
Ozkan Sezer 6dc96aa7 2022-11-18T18:02:10 SDL_UDEV_DelCallback: return early if _this is NULL Fixes https://github.com/libsdl-org/SDL/issues/6548
Sylvain 16824865 2022-11-18T11:01:21 Cleanup of SDL_SetError that already return -1 value
Ryan C. Gordon a1702d46 2022-11-16T23:39:41 ibus: Try to use org.freedesktop.portal.IBus first if available. This should fix apps that want ibus support inside sandboxed environments like FlatPak or Snaps. Fixes #4706.
Sylvain 1d7966df 2022-11-16T21:27:16 Remove un-needed check for NULL pointer. They were previously checked just before.
ulatekh ec58a817 2022-10-05T19:26:09 Fixes made in response to running a static code analyzer under MS Windows. Most of these are probably harmless, but the changes to SDL_immdevice.c and SDL_pixels.c appear to have fixed genuine bugs. SDL_audiocvt.c: By separating the calculation of the divisor, I got rid of the suspicion that dividing a double by an integer led to loss of precision. SDL_immdevice.c: Added a missing test, one that could have otherwise led to dereferencing a null pointer. SDL_events.c, SDL_gamecontroller.c, SDL_joystick.c, SDL_malloc.c, SDL_video.c: Made it clear the return values weren't used. SDL_hidapi_shield.c: The size is zero, so nothing bad would have happened, but the SDL_memset() was still being given an address outside of the array's range. SDL_dinputjoystick.c: Initialize local data, just in case IDirectInputDevice8_GetProperty() isn't guaranteed to write to it. SDL_render_sw.c: drawstate.viewport could be null (as seen on line 691). SDL.c: SDL_MostSignificantBitIndex32() could return -1, though I don't know if you want to cope with that (what I did) or SDL_assert() that it can't happen. SDL_hints.c: Replaced boolean tests on pointer values with comparisons to NULL. SDL_pixels.c: Looks like the switch is genuinely missing a break! SDL_rect_impl.h: The MacOS static checker pointed out issues with the X comparisons that were handled by assertions; I added assertions for the Y comparisons. SDL_yuv.c, SDL_windowskeyboard.c, SDL_windowswindow.c: Checked error-result returns.
Sam Lantinga 9f8b68a2 2022-11-11T10:24:17 Fixed building without linux/input.h https://github.com/libsdl-org/SDL/issues/6169
Hubert Maier 6a881302 2022-10-30T08:35:59 SDL_IBUS.H: Correct spelling mistake recieve -> receive
Sam Lantinga 99f2a503 2022-10-13T22:40:24 X11 scancode mapping cleanup * Consolidated scancode mapping tables into a single location for all backends * Verified that the xfree86_scancode_table2 is largely identical to the Linux scancode table * Updated the Linux scancode table with the latest kernel keycodes (still unmapped) * Route X11 keysym -> scancode mapping through the linux scancode table (which a few hand-written exceptions), which will allow mappings to automatically get picked up as they are added in the Linux scancode table * Disabled verbose reporting of missing keysym mappings, we have enough data for now
Sylvain fdef96e2 2022-10-04T12:08:09 Android: remove "nativeSetComposingText" since it's not used anymore (and it may fail registering at init if code is cleaned with proguard)
Sam Lantinga 5291e5cb 2022-10-03T17:36:17 Added version checking to SDLActivity.java Make sure the SDL java and C code match when updating SDL in a game. Right now we're assuming that we only have to make sure release versions match. We can extend the version string with an interface version if we need more fine grained sanity checking. Fixes https://github.com/libsdl-org/SDL/issues/1540
Ludovico de Nittis 379d4780 2022-09-28T10:25:24 dbus: guard against uninitialized D-Bus Before calling any D-Bus related methods we should first ensure that they were correctly loaded. In the event where `LoadDBUSLibrary()` was not able to load the D-Bus library, we should just return early, signalling with SDL_FALSE that we were unable to inhibit the Screensaver. Helps: https://github.com/ValveSoftware/steam-for-linux/issues/8815 Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
Cameron Gutman 71fb91f7 2022-09-26T21:38:09 evdev: Fix build with libudev and joystick subsystem disabled
Ozkan Sezer 339f7a2f 2022-09-16T17:28:20 SDL_windows.h: guard WIN32_LEAN_AND_MEAN and STRICT macro defines. also define them as 1, instead of empty. Reference issue: https://github.com/libsdl-org/SDL/issues/6239
Cameron Cawley fd93f817 2022-09-04T17:50:29 Assume that stdint.h is available on Windows with compilers other than MSVC <= 2008
Ludovico de Nittis 3c78ba57 2022-08-29T11:08:24 dbus: Use xdg-desktop-portal Inhibit when running under Flatpak or Snap In order to inhibit the screen saver, SDL currently uses `org.freedesktop.ScreenSaver.Inhibit()` and, as a fallback, a protocol specific method for X11 or Wayland. Accessing `org.freedesktop.ScreenSaver` is usually not allowed when inside a sandbox like Flatpak, unless the permission has been explicitly granted to the application. Another issue is that the Wayland protocol "Idle inhibit" is relatively new and not yet widely adopted. For example Mutter still doesn't support it. For those reasons, when running under Flatpak or Snap, we should try to inhibit the screen saver by using xdg-desktop-portal instead. This should give us an higher chance of success. Fixes: https://github.com/libsdl-org/SDL/issues/6075 Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
Ludovico de Nittis e8cb4da7 2022-08-26T12:28:33 Add utility function to detect if SDL is inside a sandbox Refactor the previous sandbox check in a standalone function that also includes Snap support. Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
Ludovico de Nittis a3ce700d 2022-08-25T16:18:45 dbus: Add generic internal function to send messages with reply SDL_DBus_CallWithBasicReply() allows us to send a DBus message and get its result, if it is a basic type, e.g. integer or string. With this function we avoid duplicating code. Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
Frank Praznik b72cf207 2022-08-14T09:41:42 core: linux: Don't cache the RealtimeKit D-Bus connection If the D-Bus subsystem is shutdown and restarted mid-execution, the cached connection will be invalid. Fetch it each time that it is used to ensure that the connection is always from the current context.
Adam Butcher 8f5932dc 2022-06-23T16:10:39 evdev: Support user-provided devices via SDL_EVDEV_DEVICES in non-udev mode.
Mathieu Eyraud f1390780 2022-08-02T15:25:44 Fix use after free when removing Windows audio device
Cameron Gutman a10c57df 2022-07-31T14:18:33 evdev: Report touchpad events with the correct device type
Cameron Gutman 9a33c62e 2022-07-31T14:06:59 evdev: Use SDL_bool for boolean types
Cameron Gutman f9d1f34b 2022-07-31T13:10:43 evdev: Report a unique ID for each mouse device
Cameron Gutman 574db63c 2022-07-31T12:36:11 evdev: Batch mouse axis updates until SYN_REPORT This is necessary for consistent position reports with absolute mice and improves application performance with relative mice by cutting the number of reported mouse motion events roughly in half.
Frank Praznik 22f25b03 2022-07-24T13:22:39 core: linux: Favor xdg-desktop-portal for elevating thread priority Use the xdg-desktop-portal interface to RealtimeKit1, when available, to set realtime scheduling and elevated priority for threads. This portal allows for the use of rtkit within containers such as Flatpak. It will fall back to using RealtimeKit1 directly if the xdg-desktop-portal interface is too old or not available.
Ethan Lee fff34f63 2022-07-15T09:46:53 windows: SDL_IMMDevice needed more deinit code from the Win32 path. Fixes #5919
Ethan Lee 2f0816ad 2022-07-11T13:08:30 Add SDL_GetDefaultAudioInfo. This API is supported on pipewire, pulseaudio, wasapi, and directsound. Co-authored-by: Frank Praznik <frank.praznik@gmail.com>
Ethan Lee 15d06180 2022-07-11T01:06:57 SDL_IMMDevice: Fix a WASAPI-specific leak, clean up Add()
Ethan Lee ae105ae1 2022-07-10T12:59:33 windows: Move IMMDevice work to common file, implement DirectSound enumeration support
rohlem b085c182 2022-07-04T16:38:05 make SDL_SetTextInputRect take a pointer to const The documentation doesn't state that the argument is ever modified, and no implementation does so currently. This is a non-breaking change to guarantee as much to callers.
chalonverse f317d619 2022-07-01T13:59:14 Xbox GDKX support (#5869) * Xbox GDK support (14 squashed commits) * Added basic keyboard testing * Update readme * Code review fixes * Fixed issue where controller add/removal wasn't working (since the device notification events don't work on Xbox, have to use the joystick thread to poll XInput)
Sam Lantinga 0ad65277 2022-06-29T17:26:09 Refactored code to send scancodes for an ASCII on-screen keyboard key
chalonverse 3b191580 2022-06-27T17:19:39 Windows GDK Support (#5830) * Added GDK * Simplfied checks in SDL_config_wingdk.h * Added testgdk sample * Added GDK readme * Fixed error in merge of SDL_windows.h * Additional GDK fixes * OpenWatcom should not export _SDL_GDKGetTaskQueue * Formatting fixes * Moved initialization code into SDL_GDKRunApp
unknown 51c6488f 2022-06-26T18:47:34 Add support for SDL_render_d3d12.c to compile in C++ mode
Ozkan Sezer 2316e568 2022-06-19T11:32:10 SDL_windows.h: match WINVER value to _WIN32_WINNT.
Ozkan Sezer 22a29321 2022-06-19T11:32:10 tweak _WIN32_WINNT value for shellscalingapi.h present but no d3d12
Mathieu Eyraud 00b95e98 2022-06-18T16:59:35 Fix read of uninitialised variable If the condition (dbus->message_iter_get_arg_type(&sub) == DBUS_TYPE_STRING) is false, subtext is not initialised.
Sam Lantinga adc68758 2022-06-17T10:22:28 Added SDL_copyp to avoid size mismatch when copying values (thanks @1bsyl!) Closes https://github.com/libsdl-org/SDL/pull/5811
Guldoman e5a3acd6 2022-05-05T04:01:05 ime: fcitx: Retrieve cursor position and selection Also, if `SDL_HINT_IME_SUPPORT_EXTENDED_TEXT` is enabled, make use of `SDL_TEXTEDITING_EXT` by sending the full preedit string.
Guldoman dd7bed9e 2022-05-05T03:10:35 ime: ibus: Retrieve cursor position and selection Also, if `SDL_HINT_IME_SUPPORT_EXTENDED_TEXT` is enabled, make use of `SDL_TEXTEDITING_EXT` by sending the full preedit string.
chalonverse 40828218 2022-06-06T17:42:30 DirectX 12 Renderer (#5761) * DirectX 12 Renderer (27 squashed commits) * Add missing SDL_hidapi.h of merge of SDL.vcxproj.filters * Fixed OpenWatcom build failure * Dynapi fix Co-authored-by: Ryan C. Gordon <icculus@icculus.org>
Sam Lantinga fd2a2eea 2022-05-28T07:49:18 Fixed declaration-after-statement warning
Cameron Cawley 9dfa000b 2022-05-18T20:20:03 Initial support for building for Windows with OpenWatcom
Cameron Cawley 622311c0 2022-05-18T22:51:58 Add extra XInput structures and defines for older SDKs
Sam Lantinga 8cd908e0 2022-05-06T10:51:55 Fixed building with Visual Studio 2013 Added SDL_vacopy.h since it needs to be included after Windows headers
Dimitriy Ryazantcev c39df2fb 2021-12-22T18:27:10 joystick: get HID top-level collection preparsed data directly from RawInput API.
Cameron Gutman 8982d9f4 2022-04-18T21:19:25 windows: Fix RoInitialize() failure after a CoInitializeEx() call using apartment threading This mirrors the same codepath in WIN_CoInitialize() which handles STA and MTA.
Cameron Gutman 923cb446 2022-04-20T21:02:40 windows: Fix calling convention for RoInitialize/RoUninitialize Fixes #5563
Weng Xuetian 138d96c8 2022-04-05T19:30:25 Send key release event to input method. (#5281) Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Weng Xuetian ff5b67e5 2022-01-30T16:29:05 IBus should use ev keycode instead of X keycode See: https://github.com/ibus/ibus/blob/5a455b1ead5d72483952356ddfe25b9e3b637e6f/client/gtk2/ibusimcontext.c#L468
Ozkan Sezer 312c899f 2022-04-02T03:32:10 attempt to fix uwp build
Ozkan Sezer 575dadb1 2022-04-02T02:20:02 fix build against older SDKs after commit 8ebef12.
Sam Lantinga 8ebef12d 2022-04-01T14:58:33 Use RoInitialize/RoUninitialize for Windows.Gaming.Input Thanks @walbourn! Fixes https://github.com/libsdl-org/SDL/issues/5270
Sam Lantinga b22ce2b5 2022-03-17T17:10:40 Workaround for bug in Microsoft WGI support Fixes https://github.com/libsdl-org/SDL/issues/5270
Guus Waals 7495b981 2022-03-11T15:14:51 Make SDL_VIDEO_OPENGL_EGL optional on Android
Cacodemon345 d90bd261 2022-02-16T13:26:10 wscons: Make USB keyboard input layout independent
Sylvain fe2ed6cf 2022-02-01T11:30:43 Fixed bug #5221 - Add SDL_AndroidSendMessage()
pionere ebdd5366 2022-01-17T16:26:02 use SDL_InvalidParamError or SDL_assert instead of custom SDL_SetError
Ozkan Sezer d2456b6e 2022-01-21T11:50:40 os2, geniconv: default functions pointers to Uni*() API, In case they get accessed before SDL_Init() was called.
Sam Lantinga 120c76c8 2022-01-03T09:40:00 Updated copyright for 2022
Sylvain a1e992b1 2021-12-21T22:07:17 Fixed bug #5118 - [Android] PointerIcon leak in Cursor API
Ozkan Sezer 48d1ef8f 2021-12-17T07:33:10 another unsigned char cast in os2cp.c. code clean-up in os/2 geniconv.
Ozkan Sezer dac65160 2021-12-17T02:50:40 os2iconv.c (_createUconvObj): cast to unsigned char, to be safe.
Ozkan Sezer 615f7b44 2021-12-08T23:51:56 more updates to os2 makefile for libiconv
Cameron Gutman 2d673e5b 2021-12-06T22:07:33 evdev: Add support for REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES If supported, these come alongside the regular REL_WHEEL and REL_HWHEEL events so it's important that we only process one or the other.
Weng Xuetian 5056b29b 2021-12-02T17:14:58 Fix the wrong int size for fcitx capability.
Ozkan Sezer 70c5e91d 2021-12-01T01:20:10 os/2 optionally builds against libiconv.
Ozkan Sezer b20484e8 2021-12-01T01:20:02 minor os/2 reorganization for iconv
Sam Lantinga 6872cb12 2021-11-28T21:10:46 null-terminate the message buffer if FormatMessage() fails
Sam Lantinga e04a0221 2021-11-27T09:36:44 Fixed crash running SDL test programs on UWP