Commit Graph

13120 Commits (87eae9a0a133c4a5c0c0f1e05e4b52b53962c963)

Author SHA1 Message Date
SDL Wiki Bot ad0c0d3cde Sync SDL3 wiki -> header 2023-07-26 17:17:06 +00:00
Frank Praznik f8e8dff7ee tests: Fix automated window grab and positioning tests under Wayland/XWayland
When using the Wayland video driver or X11 under XWayland, create a renderer and present a frame as part of window creation, as Wayland requires that a frame be presented for the window to be fully mapped and displayed onscreen. This fixes the grab and expected window size tests.

This also disables the window positioning tests when running under the Wayland driver, as Wayland does not allow application windows to position themselves in the desktop space, which renders the tests unreliable and subject to spurious failure.
2023-07-26 10:08:27 -04:00
Starbuck5 4cffbc3644 Add VS code directory to gitignore 2023-07-25 23:36:14 -07:00
Starbuck5 666f81bace Add more endian-specific aliases for 32 bit pixelformats
Add these for all the RGBX variants, just like all the RGBA variants already have.
2023-07-25 23:35:42 -07:00
Sam Lantinga 4749df0a63 Just disable the 4214 warning instead of trying to change the structure definition 2023-07-25 14:01:46 -07:00
Sam Lantinga b8d91252c6 Fixed automation tests using the dummy video driver 2023-07-25 11:48:10 -07:00
Sam Lantinga a16b241b89 Make sure the mouse and keyboard focus is cleared when a window is hidden 2023-07-25 11:47:55 -07:00
Sam Lantinga 21692bc9a8 Cleaned up dummy evdev initialization 2023-07-25 10:44:40 -07:00
Sam Lantinga 3c8f4dca1d Make sure we don't touch the controller effects state when we're in auto mode for PS4/PS5 controllers. 2023-07-24 10:17:02 -07:00
Sam Lantinga 8adab0b88a Removed invalid assert in testatomic 2023-07-22 18:39:39 -07:00
Anonymous Maarten d5479d7b81 project: build in (at least) c99 mode 2023-07-22 15:55:48 -04:00
Anonymous Maarten 8105f1d5b5 SDL_atomic.h: __ARM_ARCH is not always defined for an arm platform
e.g. riscos toolchain
2023-07-22 15:55:48 -04:00
Anonymous Maarten b8c8968b69 ci: disable precompiled headers for riscos 2023-07-22 15:55:48 -04:00
Frank Praznik 96720f3350 wayland: Don't clamp the max window size when unbounded 2023-07-22 11:42:23 -04:00
Anonymous Maarten 3823219b28 ci: bump mymindstorm/setup-emsdk to latest tag 2023-07-22 17:36:02 +02:00
Frank Praznik 813e7c3992 wayland: Ensure that the maximum libdecor frame size limit is above the required minimum
Both the minimum and maximum libdecor frame size limits must meet or exceed the required minimum size, or the libdecor plugins can error and/or crash.
2023-07-22 10:26:33 -04:00
Alexander Richards ec5088cb99 src/SDL.c: add managarm support 2023-07-21 22:45:21 -04:00
Weng Xuetian d4519aafd3 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.
2023-07-20 13:36:33 -07:00
Frank Praznik 5c2fb6eb61 wayland: Adjust the position of existing popups when resizing a window
When resizing a window, adjust the size of the anchor rect and ensure that existing popups remain in bounds/adjacent to avoid a protocol error.
2023-07-20 15:10:39 -04:00
Frank Praznik 72a489e6be wayland: Always use the requested compositor dimensions for fullscreen windows
In the event that the compositor sends window dimensions of (0,0), use the last requested compositor dimensions for fullscreen windows as opposed to trying to guess the target dimensions from the output, which can be null if no outputs are present, or wrong in the case of multi-display setups.  Fullscreen windows must respect the maximum dimensions reported by the compositor, or a protocol violation can result.

This also prevents possible crashes if the compositor sends a config event with dimensions of (0,0) before a display has been added and/or finalized.
2023-07-20 12:06:59 -04:00
Anonymous Maarten 3ab4665956 cmake: bump minimum required CMake version to 3.16
main features:

- No more sdl-build-options/sdl-shared-build-options/sdl-global-options
- Dependency information is stored on SDL3-collector for sdl3.pc
- Use helper functions to modify the SDL targets;
    - sdl_sources to add sources
    - sdl_glob_sources to add glob soruces
    - sdl_link_dependency to add a link dependency that might also
      appear in sdl3.pc/SDL3Config.cmake
    - sdl_compile_definitions to add macro's
    - sdl_compile_options for compile options
    - sdl_include_directories for include directories
  They avoid repeated checks for existence of the SDL targets
- A nice feature of the previous is the ability to generate
  a sdl3.pc or SDL3Config.cmake that describes its dependencies
  accurately.

various:

- remove duplicate libc symbol list
- add CheckVulkan
- remove unused HAVE_MPROTECT
- add checks for getpagesize
2023-07-20 17:58:06 +02:00
SDL Wiki Bot a3a9019265 Sync SDL3 wiki -> header 2023-07-20 14:55:15 +00:00
Anonymous Maarten a4bb4eef73 cmake: create Android jars + apks for tests 2023-07-20 16:54:29 +02:00
Sam Lantinga 58882425fc Use the lower index axis if the controller generates two axes for a single element
The Flydigi Apex and Vader controllers fire both axis 4 and 5 for the right thumbstick Y axis, for example.
2023-07-19 09:48:32 -07:00
Sam Lantinga 255f297439 Fixed crash if SetMappingValue() is passed a NULL key 2023-07-19 09:23:08 -07:00
Sam Lantinga 58e3084477 The Flydigi Vader and Apex series controllers all have the same VID, PID, and name 2023-07-19 09:22:01 -07:00
Sam Lantinga e413457a7e Fixed clearing the mapping in testcontroller 2023-07-18 22:10:44 -07:00
Sam Lantinga 732218c222 Changed binding order to match Steam 2023-07-18 22:04:55 -07:00
Sam Lantinga 53882a2ed2 Map the buttons in ABXY order 2023-07-18 17:36:40 -07:00
Sam Lantinga 85eb1fa515 Fixed double-comma if the crc is first in the mapping 2023-07-18 17:32:46 -07:00
Sam Lantinga c0e0f47755 Make sure there are commas in gamepad mapping strings 2023-07-18 17:11:02 -07:00
Anonymous Maarten b1a0bc3fb0 testlocale: only ininitialize video when needed 2023-07-19 00:14:38 +02:00
Ozkan Sezer 4ca0e937e1 hidapi: remove unwanted files (e.g.: .git*, etc...) 2023-07-19 00:55:04 +03:00
Ozkan Sezer 40ac818bf8 hidapi: sync with mainstream (typo fixes) 2023-07-19 00:40:10 +03:00
Sam Lantinga 2bf05f38ad Increased the timeout when opening /dev/hidraw nodes
We're still seeing it taking longer than 10ms for permissions to become available on Steam Deck.
2023-07-18 14:28:55 -07:00
Anonymous Maarten e620925728 testlocale: don't pass SDL_INIT_VIDEO to SDL_Init 2023-07-18 22:48:14 +02:00
Frank Praznik ef4ce8cec5 test: Add flag to suspend drawing when occluded
Add the flag "--suspend-when-occluded" to testgl, testgles2, and testsprite, which, when used, will suspend rendering and throttle the event loop when the occlusion flag is set on the window.
2023-07-18 16:42:05 -04:00
Frank Praznik 44536b7537 Add and event and flag to report when a window has been occluded
Adds the SDL_EVENT_WINDOW_OCCLUDED events and the window flag SDL_WINDOW_OCCLUDED to report when the window occlusion state has changed, so that the application can take appropriate measures, as it may wish to suspend drawing, throttle, or otherwise behave in a more energy efficient manner when the window is not visible. When the window is no longer occluded, the SDL_EVENT_WINDOW_EXPOSED event is sent and the occlusion flag is cleared.

This is handled on macOS via the window occlusion state event (available as of 10.9), and via the xdg-shell protocol on Wayland (version 6, wayland-protocols 1.32, passed through in libdecor 0.1.2).
2023-07-18 16:42:05 -04:00
Sam Lantinga 7aec9ad4a6 Make sure the mapping string doesn't have extraneous whitespace
If that whitespace is extra newlines in the mapping hint, we would create extra empty mapping strings
2023-07-18 13:25:47 -07:00
Sam Lantinga 9db2cb3513 Added SDL_ReloadGamepadMappings() to reset the SDL gamepad mappings 2023-07-18 12:50:10 -07:00
Sam Lantinga 75e7a6fcfa SDL_AddGamepadMappingsFromFile() has been made into a real function 2023-07-18 12:05:04 -07:00
Sam Lantinga dfc6e8825e Improved reliability of gamepad message ordering
The gamepad vs joystick events always happen in this order:
SDL_EVENT_JOYSTICK_ADDED
SDL_EVENT_GAMEPAD_ADDED
SDL_EVENT_GAMEPAD_REMAPPED
SDL_EVENT_GAMEPAD_REMOVED
SDL_EVENT_JOYSTICK_REMOVED

Whenever a mapping is changed, any controller affected by that mapping will generate a gamepad event. You will only get one SDL_EVENT_GAMEPAD_REMAPPED event per controller per batch of mapping changes, where SDL_AddGamepadMappingsFromFile() and SDL_AddGamepadMapping() are each a batch of changes.
2023-07-18 11:52:56 -07:00
Sam Lantinga ccefce8321 Send gamepad and joystick removed events when quitting
This helps applications do proper cleanup when reinitializing gamepads, e.g. to reset controller mappings
2023-07-18 09:01:14 -07:00
Sam Lantinga 0a4e6f6d29 Added SDL_strnlen() and SDL_wcsnlen() 2023-07-17 19:37:51 -07:00
rfht 4d63c919f9
simplify OpenBSD D-pad calculation with bitwise operation (#7996) 2023-07-17 19:01:23 -07:00
Sam Lantinga 4a18893c73 Don't fail to create a window if it's too large, just clamp it to the max instead
Some window is better than no window...
2023-07-17 17:48:11 -07:00
Sam Lantinga eb8b5ed3a4 Fixed crash when the joystick can't be opened 2023-07-17 17:35:38 -07:00
Sam Lantinga 2ebbfe7c5b Added an "auto" mode for PS4 and PS5 controller rumble hints
This allows the controllers to report that they have sensors and enhanced capabilities, but not actually switch into enhanced mode (breaking DirectInput) unless the application tries to use them.
2023-07-17 17:32:57 -07:00
Sam Lantinga bd4f155bbb Fixed LED pending check failing when the controller timestamp is very large
In this case we know the controller has been on for a while and the Bluetooth connection LED cycle is complete.

Also fixed the timestamp being zero the first time it is checked
2023-07-17 17:08:17 -07:00
Sam Lantinga 16dd5f0da4 Don't send k_EPS5FeatureReportIdCapabilities to Sony PS5 controllers
This report is for third party controllers only.
2023-07-17 16:45:31 -07:00