Commit Graph

9274 Commits

Author SHA1 Message Date
Luke Street b8bf551bc0 Update switch/SDL_systimer.c; fix Switch link issues 2022-06-02 00:42:19 -04:00
Luke Street dd75de95be Update switch/SDL_sysjoystick.c 2022-06-02 00:42:10 -04:00
Luke Street 6948c1a72c Function prototype updates for SDL_switchaudio.c and SDL_sysjoystick.c 2022-05-31 14:31:24 -04:00
Luke Street 77d6f16906 Merge remote-tracking branch 'upstream/2.0.22' into switch-sdl2-2.0.14-dev
# Conflicts:
#	.gitignore
#	CMakeLists.txt
#	configure
#	configure.ac
#	include/SDL_config.h.cmake
#	include/SDL_config.h.in
#	sdl2-config.cmake.in
#	src/dynapi/SDL_dynapi.h
#	src/joystick/SDL_gamecontrollerdb.h
#	src/joystick/SDL_sysjoystick.h
#	src/video/SDL_video.c
#	src/video/khronos/EGL/eglplatform.h
2022-05-31 13:17:31 -04:00
Ryan C. Gordon 031c9b03f1 x11: send move/resize events when waiting on fullscreen change.
Otherwise we ignore the Configure/etc events when they come in because
the window is already in an identical state as far as SDL is concerned.

Fixes #5593.

May also fix:
Issue #5572.
Issue #5595.
2022-05-20 08:30:46 -07:00
Daniel Brookman 09086aefaa Fix crash when reading background events for MFi controllers on macOS
Enabling GCController.shouldMonitorBackgroundEvents to read background events
for MFi controllers before receiving the first GCControllerDidConnectNotification
is apparently a no-go on macOS (12.3.1 for me), and would crash on attempt.
Apple's documentation is... not great, and doesn't point this out.

This waits for IOS_AddMFIJoystickDevice() to get called down the chain from GCControllerDidConnectNotification, and enables GCController.shouldMonitorBackgroundEvents
if it hadn't been already.

On iOS and tvOS, GCController.shouldMonitorBackgroundEvents is ignored, so
there's no need to check their versions.
(cherry picked from commit d1a3981bf8)
2022-05-19 22:00:28 +03:00
Ozkan Sezer f8e14ad25a disable dynapi for os/2, at least for now. (see bugs #5667 and #5669.) 2022-05-17 01:35:24 +03:00
Ozkan Sezer 0c05ddd9ff SDL_malloc.c: workaround calling convention issues for real_xxx procs.
(cherry picked from commit ec1a0f62dd)
2022-05-17 01:34:28 +03:00
R-YaTian 988d15cfe9
Improve single joycons mode (#16)
* Set NpadJoyHoldType_Horizontal for single joycons

* Improve single joycons mode
2022-05-15 15:22:53 +02:00
Ryan C. Gordon 53dea98309
x11: revert checks for _NET_WM_STATE_FULLSCREEN changes.
This reverts commit 85977354fb.
This reverts commit 0249df9d96.

Fixes #5572.
Reopens #5390.
2022-04-25 14:00:04 -04:00
Sam Lantinga 981e1e3c44 Fixed logical size synchronization issue on macOS
https://discourse.libsdl.org/t/sdl-2-0-22-prerelease/35306/6
2022-04-23 10:35:05 -07:00
Ozkan Sezer 7a5743031d hidapi, libusb: import mainstream commit 536bad201e 2022-04-23 20:01:40 +03:00
Sam Lantinga fa073ed01a Revert "Fix relative mouse input for Unvanquished (unvanquished.net)"
This reverts commit 3318590796.

Fixes https://github.com/libsdl-org/SDL/issues/5569
2022-04-22 22:31:04 -07:00
Sam Lantinga 8986efd643 Added support for the Backbone One controller on iOS 2022-04-22 14:21:46 -07:00
Sam Lantinga 2ca0837888 SDL: sometimes the PS5 controller doesn't report having to power even when connected over USB. Possibly related to being completely charged? Either way we already know that it's USB or BT so let's use the driver's knowledge instead. 2022-04-22 14:21:41 -07:00
Sam Lantinga 04bf7c9434 Fixed build 2022-04-22 09:36:39 -07:00
Sam Lantinga d9b5805ba5 Return a correlation error when trigger rumble is attempted without correlation 2022-04-22 09:13:40 -07:00
Eddy Jansson 0288de8529 SDL_Rect: Add \sa documentation block to SDL_FRect 2022-04-22 12:09:13 -04:00
Sam Lantinga ba62ead5ec Handle potential out of memory condition when working with hints 2022-04-21 08:47:41 -07:00
Cameron Gutman 145824f6ab WGI: Only call RoUninitialize() if RoInitialize() succeeded 2022-04-21 08:47:22 -07:00
Cameron Gutman 00b2e10a7a WGI: Keep a reference to the MTA to avoid crashing on COM teardown
Fixes #5552
Fixes #5270
2022-04-21 08:47:22 -07:00
Cameron Gutman 8982d9f403 windows: Fix RoInitialize() failure after a CoInitializeEx() call using apartment threading
This mirrors the same codepath in WIN_CoInitialize() which handles STA and MTA.
2022-04-21 08:47:22 -07:00
Cameron Gutman 923cb4463e windows: Fix calling convention for RoInitialize/RoUninitialize
Fixes #5563
2022-04-20 21:02:40 -05:00
Ryan C. Gordon d4a01bfef0
os2: SDL_DestroyMutex should ignore NULL mutexes.
Every other backend does this, so this should match, now.
It's possible this was harmless, but we can avoid the system call
and the (likely?) debug message when it fails, though!
2022-04-20 14:08:09 -04:00
Eddy Jansson a40405d724 hidapi: Wrap CopyHIDDeviceInfo in define checks.
The purpose of this is to silence a 'defined but not used'
warning.
2022-04-20 09:33:40 -07:00
Eddy Jansson 5bc2933425 test: Basic tests for SDL_FRectEquals
Based on the integer version. These tests mostly check that input
isn't mangled and that invalid input gives the expected negative
result.
2022-04-20 08:38:53 -07:00
Eddy Jansson fc944859d1 SDL_Rect: Use a default epsilon in SDL_FRectEquals()
Add SDL_FRectEqualsEpsilon() for when more control over
equality test is required.
2022-04-20 08:38:53 -07:00
Eddy Jansson 00feca27b0 Add SDL_FLT_EPSILON. 2022-04-20 08:38:53 -07:00
Eddy Jansson 5d4a1f8356 WhatsNew.txt: Add SDL_FRectEqualsEpsilon() 2022-04-20 08:38:53 -07:00
Frank Praznik aeadbdd788 Remove an unused function prototype 2022-04-20 09:39:34 -04:00
Frank Praznik c8c59a2139 Fix a -Wshadow warning 2022-04-20 09:39:34 -04:00
Jaylon Gowie d9009388c8 SceKernelMemBlockType to unsigned int 2022-04-19 14:17:27 -07:00
Jaylon Gowie 3753a7b1c3 Fix recent changes in VitaSDK 2022-04-19 14:17:27 -07:00
Sam Lantinga 02225aa738 Fixed build 2022-04-18 22:57:03 -07:00
Ryan C. Gordon 49a2e4b0ea
x11: Revert "Fix keymap updating for X11 backend"
This reverts commit de6d290266.

This patch had multiple issues, discussed in #5520.
2022-04-19 00:37:39 -04:00
Sam Lantinga b9fe6ba0e7 Fixed compile warnings 2022-04-18 13:09:08 -07:00
Sam Lantinga 57927a2458 Don't call scandir() inside of scandir()
This works around a crash in address sanitizer
2022-04-18 12:57:28 -07:00
Sylvain 1ede941f5c SDL_render.c: internally change viewport/cliprect type from SDL_FRect to SDL_DRect (double precision). (see bug #5547) 2022-04-18 12:26:32 -07:00
Sam Lantinga 9919d1a7a5 Remove HWND_TOPMOST for fullscreen windows
Fixes https://github.com/libsdl-org/SDL/issues/5509
2022-04-18 11:51:54 -07:00
pionere 009a0ff95f use explicit GetModuleFileNameW 2022-04-18 14:12:22 -04:00
pionere de711e1685 simplify SDL_GetBasePath on windows
- use GetModuleFileName directly (as recommended)
2022-04-18 14:12:22 -04:00
Jan Beich 7c140429a8 Enable evdev-based gamecontrollerdb on FreeBSD 2022-04-18 09:57:49 -07:00
Sam Lantinga e7b01ee745 Added controller mapping for the Thrustmaster Dual Analog 3.2 on Linux 2022-04-18 09:55:52 -07:00
Frank Praznik 2b52946143 video: Don't minimize fullscreen windows on focus loss by default when mode switching is disabled
When mode switching is disabled in a video backend, fullscreen windows are basically just fullscreen desktop windows with different internal scaling.  As no mode switching occurs, there's no need to minimize them on focus loss by default.  This can still be overridden by explicitly setting the internal hint for minimizing on focus loss.

This has the side effect of fixing a bug on GNOME, where, when a fullscreen Wayland window has it's focus lost and restored via alt+tab followed by switching back to windowed mode, the top portion of the window won't end up being obstructed by GNOME's top bar.
2022-04-18 09:39:25 -07:00
Ethan Lee c37090f9a4 wayland: Add support for TOOLTIP/POPUP_MENU 2022-04-18 12:31:02 -04:00
Sam Lantinga 9e264b921b Certain audio drivers, like the RME "Pro" Audio driver, have resampling quality issues when using WASAPI.
We'll use SDL's resampling algorithm so we have consistent quality between platforms and drivers.

Fixes https://github.com/libsdl-org/SDL/issues/5538
2022-04-18 09:20:47 -07:00
Sam Lantinga 254fcc90eb Revert "video: Prefer Wayland over X11"
This reverts commit 8ceba27d62.

SDL Wayland support is stable, but there are a number of issues with third-party software (NVIDIA drivers, libwayland event overflow, libdecor not handling plugin load failures, Steam overlay not working with Wayland, etc.) that make it better to default to X11 at this time.

Games which would like to prefer wayland when available can use the following code before SDL_Init():
	SDL_SetHint(SDL_HINT_VIDEODRIVER, "wayland,x11");

Fixes https://github.com/libsdl-org/SDL/issues/5527
2022-04-18 09:03:14 -07:00
Ryan C. Gordon c1336b21ed hints: Make SDL_VIDEODRIVER and SDL_AUDIODRIVER formal hints.
They were just environment variables before.

Fixes #5528.
2022-04-17 11:31:55 -07:00
Ryan C. Gordon 634b9edc7f
cmake: Fixed indenting and some oldschool `endif(TEXT)` things. 2022-04-15 20:50:55 -04:00
Semphris dc5bc5237c Added CMake option to disable the installer 2022-04-15 20:48:40 -04:00