Commit Graph

7132 Commits

Author SHA1 Message Date
Ozkan Sezer
6ea66f8302 SDL_test_fuzzer.c: fix strict aliasing warnings by using a union. 2018-02-25 10:15:00 +03:00
Sam Lantinga
7c987672d4 Fixed bug 4091 - Undefined references to Android audio functions when SDL_AUDIO_DISABLED is on
Manuel Sabogal

If SDL is compiled with the Audio subsystem disabled there are some undefined references to the functions ANDROIDAUDIO_ResumeDevices and ANDROIDAUDIO_PauseDevices in the file src/video/android/SDL_androidevents.c.
2018-02-24 08:58:22 -08:00
Sam Lantinga
bcfa3a73b8 Fixed MinGW-w64 build 2018-02-24 08:23:44 -08:00
Brandon Schaefer
149c55a3fd Backout the vulkan change in cd67e676bca7 breaks Mir builds 2018-02-23 19:12:04 -05:00
Brandon Schaefer
1e7c6e97ff mir: Disable Mir by default as Mir supports Wayland clients
Also remove enabling VK support for Mir
2018-02-23 11:24:26 -05:00
Ryan C. Gordon
5117e52a11 Backed out changeset bd976b7b2b43
Apparently this still triggers a compiler warning, have to dig further.
2018-02-21 22:53:52 -05:00
Ryan C. Gordon
b32b2a680c android: apparently they fixed this header at some point. 2018-02-21 22:35:17 -05:00
Ryan C. Gordon
3dbbb39132 vulkan: Possibly fix a compiler warning (-Wstrict-prototypes). 2018-02-21 22:27:09 -05:00
Ryan C. Gordon
7d92099fee wasapi: let Windows do the resampling for us if possible. 2018-02-21 21:34:06 -05:00
Ryan C. Gordon
b3d32bb003 wasapi: fixed typo in an assert message. 2018-02-21 21:34:35 -05:00
Ryan C. Gordon
73e151fc52 windows: added WIN_IsWindows7OrGreater(). 2018-02-21 21:36:10 -05:00
Ethan Lee
9b4912815b Use new XInput mapping for Win10+ (Bugzilla #3960) 2018-02-21 12:42:30 -05:00
Mark Callow
220ef7f3b9 Fix high-dpi support on macOS and simplify it and iOS variant.
The detault drawableSize for a CAMetalLayer is its bounds x its scale.
So it is sufficient to set the *layer's* scale to the desired value.
2018-02-21 09:58:21 -08:00
Sam Lantinga
986b771c30 Fixed bug 4034 - Don't include _DllMainCRTStartup() if SDL_STATIC_LIB is defined. 2018-02-21 09:40:47 -08:00
Sam Lantinga
c6bc5d1904 Actually, this is needed for building with Visual Studio with both /MT and /MD.
With the previous change, I get:
1>     Creating library C:\projects\SDL\VisualC\Win32\Debug\SDL2.lib and object C:\projects\SDL\VisualC\Win32\Debug\SDL2.exp
1>LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
2018-02-18 09:09:56 -08:00
Sam Lantinga
f6a5126a8f Fixed bug 4034 - Do we really need _DllMainCRTStartup() in every Windows build?
Andreas Falkenhahn

In src/SDL.c there is this code:

_DllMainCRTStartup(HANDLE hModule,

...

The comment says that this is needed on Watcom C for some reason but why is it included then when building with Visual C as well? Shouldn't it be only included when compiling on Watcom C then?

I'm asking because this code caused me a lot of headaches because I'm building a DLL that contains SDL and I link using /MT and the _DllMainCRTStartup() symbol obviously led to lots of trouble but it wasn't clear to me where the problem was because all I got from the linker was:

LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

So I had to got through each and every object to see what the culprit was. See here for the full story:
https://stackoverflow.com/questions/25067151/lnk2019-unresolved-external-symbol-main-referenced-in-function-tmaincrtstar/48177067#48177067

So if it isn't necessary on Visual C, please just leave that symbol out on Visual C so that it no longer leads to any trouble. Thanks.
2018-02-18 08:57:01 -08:00
Ryan C. Gordon
2c26c27543 pthread: fix error code checks (thanks, Andreas!).
Most pthread functions return 0 on success and non-zero on error, but those
errors might be positive or negative, so checking for return values in the
Unix style, where errors are less than zero, is a bug.

Fixes Bugzilla #4039.
2018-02-17 23:57:57 -05:00
Ryan C. Gordon
b3687328f2 yuv: patched to compile. 2018-02-17 20:18:48 -05:00
Ryan C. Gordon
002b5892bb yuv: fixed variable declaration shadowing warnings.
Fixes Bugzilla #4062.
2018-02-17 20:10:13 -05:00
Ryan C. Gordon
3050b440f8 pulseaudio: Just read/dump captured data in FlushCapture.
Apparently pa_stream_flush() doesn't work as expected:

https://lists.freedesktop.org/archives/pulseaudio-discuss/2012-April/013328.html

Fixes Bugzilla #4087.
2018-02-17 18:30:21 -05:00
Ryan C. Gordon
3e76436bcf video: put a spinlock around a global linked list.
This should only contend if you're allocating or freeing surfaces from
multiple threads at once, and then just for a short time.

Fixes Bugzilla #4084.
2018-02-16 14:56:28 -05:00
Sam Lantinga
f8023f1dd4 Fixed bug 4085 - X11: Allow configuring _NET_WM_BYPASS_COMPOSITOR through SDL hints
Callum McGing

This patch allows the user to disable the behaviour that blocks the compositor through a new hint: SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR. This allows tools or other windowed applications to behave properly under KWin.
2018-02-16 10:23:10 -08:00
Ozkan Sezer
7eaf8603c7 bug #3739: handle %lu, %li and %ld in SDL_SetError. 2017-10-29 14:15:00 +03:00
Sam Lantinga
e465610bd4 Don't attempt WM_NCCALCSIZE adjustment when in fullscreen window transition 2018-02-13 22:58:20 -08:00
sezero
c181d919af fix building SDL_audiotypecvt.c with gcc < 4.0 2018-02-12 10:47:00 +03:00
sezero
7287068da5 revert the recent typecast assignment changes (see bug #4079)
also change the void* typedefs for the two vulkan function
pointers added in vulkan_internal.h  into generic function
pointer typedefs.
2018-02-12 17:00:00 +03:00
Sam Lantinga
9d193f9109 Fixed bug 3920 - IBus not work with SDL 2.0.7
cjacker

After updating from 2.0.5 to 2.0.7, Ibus not work anymore(fcitx still works).

Compare with 2.0.5, there are two issues in SDL_ibus.c.

1, SetupConnection always return SDL_FALSE in 2.0.7.

2, 'SetCapabilities' method should be called on 'ibus_conn'.

Patch attached.
2018-02-13 08:15:39 -08:00
Sam Lantinga
add5711436 Fixed bug 3947 - replace strlcpy with memcpy in SDL_strdup() 2018-02-13 08:13:29 -08:00
Sam Lantinga
eb6e89e3fd Fixed bug 3950 - Don't always call dbus_shutdown in SDL_DBus
Alexander Larsson

dbus_shutdown() is a debug feature which closes all global resources in the dbus library. Calling this should be done by the app, not a library, because if there are multiple users of dbus in the process then SDL could shut it down even though another part is using it.

For example, i had an issue with this in mGBA, which uses both Qt and SDL, both using libdbus. I had a session bus, but no system bus (this was in a flatpak sandbox), and when SDL_DBus_Init() failed to init the system bus it called dbus_shudown() and continued on. This caused issues for Qt when running due to its session bus connections having disappeared beneath it.
2018-02-13 08:07:52 -08:00
sezero
42a6c0d693 kill C99'ism in SDL_waylandvulkan.c 2018-02-12 10:00:00 +03:00
Sam Lantinga
6fcd640364 On Android show the system UI when an SDL window is windowed, hide the system UI when it's fullscreen, like we do on iOS.
We're increasing the Android SDK minimum version to API 19, this doesn't increase the minimum target API, which is API 14.
2018-02-11 18:23:37 -08:00
Sam Lantinga
d89ff59577 ISO C correct fix for casting void* to function pointer 2018-02-11 15:29:36 -08:00
Ryan C. Gordon
e3528b63d0 vulkan: Fix assignment of vkGetInstanceProcAddr on Windows.
"*(void**)pfn = LoadAddress()" would cast the NULL pointer in pfn to a
void**, and then dereference it, which wasn't what we wanted. Replaced with
a clearer cast operation.
2018-02-11 18:16:01 -05:00
Sam Lantinga
a9196a5280 Fixed bug 4073 - Unquoted Unicode argument parsing broken on Windows due to incorrect usage of SDL_isspace() 2018-02-10 12:43:11 -08:00
Sam Lantinga
8a477f57e7 Fixed compile warning 2018-02-09 16:31:57 -08:00
Sam Lantinga
7ceef7fd16 Fixed compiler warning on Android 2018-02-09 16:01:11 -08:00
Sam Lantinga
dec734e510 Fixed min/max window size handling for borderless resizable windows 2018-02-08 18:07:14 -08:00
sezero
4afad75308 add SDL_log10 and SDL_log10f to include and dynapi 2018-02-08 17:07:47 +03:00
Sam Lantinga
1b533d9836 Fixed bug 4054 - Raspberry Pi refresh rate detection
Viacheslav Slavinsky

SDL_rpivideo driver has 60 frames per second hardcoded in it, this is a problem for games that need to keep pace using VSYNC. I believe that I have found a solution to this. It is based on code in tvservice.c in rpi userland:

a1b89e91f3/host_applications/linux/apps/tvservice/tvservice.c (L433)
2018-02-07 15:05:30 -08:00
Ethan Lee
ff50cc0958 SDL_log10 2018-01-17 11:53:09 -05:00
"Guillermo A. Amaral"
5f5aae7d8d Set rpath instead of changing environment for RPi
Credit goes to Adrian Perez de Castro for the improvement.

Signed-off-by: Guillermo A. Amaral <g@maral.me>
2018-02-07 14:12:26 -08:00
Sam Lantinga
20bc9a6dca Fixed bug 4060 - Alternative DualShock 4 v2 controller GUID
ayer.3d

I have a DualShock 4 v2 controller with a GUID that's not in the database. There is an existing GUID that is almost identical, with the only difference that I can tell being the reported version string (mine being 8001, database is 8100).

Existing GUID: 050000004c050000cc09000000810000
     New GUID: 050000004c050000cc09000001800000

When connected via USB, the GUID matches an existing entry: 030000004c050000cc09000011810000
2018-02-07 14:07:54 -08:00
Ryan C. Gordon
0efdf226de wayland: Add support for xdg-shell protocol (unstable v6).
This is meant to be the desktop-enhanced version of wl_shell. Right now we
just match what the existing wl_shell code does, but there are other areas of
functionality available to us now, that we can fill in later.

This uses the "unstable" API, since this is what ships in Ubuntu 17.10 (as
part of Wayland 1.10), but Wayland 1.12 promotes this to stable with extremely
minor changes. We will add support for the stable version when it makes sense
to do so.
2018-02-07 13:13:55 -05:00
Sam Lantinga
326b4ae577 Send Apple TV remote input as key events unless it's opened as a joystick, to match Android behavior. 2018-02-06 16:43:31 -08:00
Sam Lantinga
5537585efa Replaced SDL_HINT_APPLE_TV_REMOTE_SWIPES_AS_ARROW_KEYS with SDL_HINT_TV_REMOTE_AS_JOYSTICK which controls whether remotes on iOS and Android are interpreted as joysticks (the default) or as return/escape/arrow keys. 2018-02-06 15:03:38 -08:00
Sam Lantinga
2c08c2b899 Added SDL_IsAndroidTV() 2018-02-06 15:03:35 -08:00
Sam Lantinga
77806a272c SDL Changes to support clean reads
CR: saml
2018-02-05 11:40:39 -08:00
Sam Lantinga
127e43ed2d Fixed building on tvOS 2018-02-01 15:46:51 -08:00
Sam Lantinga
992ad33eaf Added SDL_HINT_IOS_HIDE_HOME_INDICATOR to determine how the home indicator on the iPhone X is handled.
This variable can be set to the following values:
   "0"       - The indicator bar is not hidden (default for windowed applications)
   "1"       - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications)
   "2"       - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications)
2018-02-01 15:21:01 -08:00
Sam Lantinga
67abefdf01 Fixed building on platforms without __sighandler_t 2018-01-30 18:12:25 -08:00