Set thread name on Android the same way as we do on Linux.
Acording to Bionic source code this function is available since 2013 [1] and
hase the same signature.
[1] 2a1bb4e646
In reality, this condition will never occur, since the index is checked before calling the display retrieval function, but aggressive LTO with jump threading can generate a warning if this isn't explicitly checked.
The objfiles of different builds show various differences in
the calls to SDL_DYNAPI_entry elements. This is generated
dynamically by gendynapi.pl which uses an unordered opendir/readdir
pair. To make the build reproducible and thereby e.g. debugging
easier change this to be used in an ordered fashion.
Fixes#11565.
(cherry picked from commit 5418740c4a)
Fixes:
src/video/directfb/SDL_DirectFB_render.c: In function ‘DirectFB_CreateRenderer’:
src/video/directfb/SDL_DirectFB_render.c:1153:35: error: assignment to ‘void (*)(SDL_Renderer *, SDL_Texture *, SDL_ScaleMode)’ from incompatible pointer type ‘void (*)(void)’ [-Wincompatible-pointer-types]
1153 | renderer->SetTextureScaleMode = DirectFB_SetTextureScaleMode;
| ^
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Notes:
- declaration was just recently changed by commit 'Fix warning for Android
NDK compiler: "function declaration without a prototype is deprecated in
all versions of C [-Wstrict-prototypes]"', see
ccade50587
WIN_AddDisplay asserted that the returned index is the expected next
one in the list. This can be an unexpected number when displays are
add and removed in a batch (eg, Remote Desktop disconnect and reconnect).
Instead always just make use of the next index, even if it is not the
expected next index value. This fixes issue #9105
(cherry picked from commit bee8874629)
There are low-latency fixes in SDL3 that really need to be backported to SDL2
before AAudio will be nicer across a range of devices, so OpenSL ES is safer
in SDL2 at the moment. At least, we suspect as such.
Fixes#11457.
This reverts commit 1e016fd5ea.
In order to use low latency mode, you need to set low latency callbacks. This has always been recommended and is apparently required on Android 15. SDL3 has these implemented correctly but SDL2 does not, so we should revert this for now.
Fixes https://github.com/libsdl-org/SDL/issues/11376
This reverts commit 120b8d4189.
The issue this was patching over in Vanilla-Conquer was the lack of an exposure event when showing a window, which has since been remedied.
Attaching EGL window objects can also cause protocol violations now that the explicit sync protocol is in use, if SDL creates one and then the client tries to attach one itself, so they really shouldn't be created unless the client specifically requested it.
Suppose host has some three-finger gesture. Then we get the following sequence
of events:
DOWN-DOWN-DOWN-MOTION-CANCEL
Note that there is no UP in this sequence. So if we don't handle CANCEL then
we end up thinking that fingers are still touching the screen. Ideally we
should inform the application that cancel has happened as not to trigger
spurious taps but still this is way better than being stuck with phantom
finger touch.
UpdateDevice() can be called at an arbitrary rate, so we need to
pace ourselves to avoid filling up the rumble queue with these.
(cherry picked from commit 6ec8b1a173)
Modern kernels (v5.8+) allow non-root usage of drmDropMaster(), so
we can hold on to our fd after dropping master on it. This fixes
populating drm_fd in the KMSDRM SysWMinfo when using Vulkan.
Also add a missing error check for open() while we're here.