Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: crash SDL_LockJoysticks() #7811

Closed
1bsyl opened this issue Jun 12, 2023 · 12 comments
Closed

Android: crash SDL_LockJoysticks() #7811

1bsyl opened this issue Jun 12, 2023 · 12 comments

Comments

@1bsyl
Copy link
Contributor

1bsyl commented Jun 12, 2023

I've seen this rare crash log:

FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xe00edeb8)

backtrace:
  #00  pc 0x000000000005ec56  /apex/com.android.runtime/lib/bionic/libc.so (abort+166)
  #01  pc 0x00000000000a72dd  /apex/com.android.runtime/lib/bionic/libc.so (__fortify_fatal(char const*, ...)+32)
  #02  pc 0x00000000000a6ae5  /apex/com.android.runtime/lib/bionic/libc.so (HandleUsingDestroyedMutex(pthread_mutex_t*, char const*)+20)
  #03  pc 0x00000000000a69d3  /apex/com.android.runtime/lib/bionic/libc.so (pthread_mutex_lock+138)
  #04  pc 0x00000000002290df  (SDL_LockMutex+4096)
  #05  pc 0x000000000021ef13  (SDL_LockJoysticks+4096)
  #06  pc 0x0000000000221835  (Android_OnPadUp+4096)
  #07  pc 0x000000000002f63f  (art_jni_trampoline+102)
  #08  pc 0x0000000000042715  (org.libsdl.app.SDLActivity.handleKeyEvent+276)
  #09  pc 0x0000000000045f3b  (org.libsdl.app.SDLSurface.onKey+58)

This seems to happen on tv / set-top box.
Possible scenario: user press a key to exit, things get terminated on key PadDown(). But the key PadUp() is also sent right after and tries to lock the joystick mutex.
The un-initialization process from PadDown event unlocks and destroys the mutex (https://github.com/libsdl-org/SDL/blob/main/src/joystick/SDL_joystick.c#L155), which triggers the 'pthread_mutex_lock called on a destroyed mutex" while sending the PadUp()

@1bsyl
Copy link
Contributor Author

1bsyl commented Jun 12, 2023

@AntTheAlchemist are you also seeing this one ?

@1bsyl
Copy link
Contributor Author

1bsyl commented Jun 12, 2023

not to destroy the mutex, seems the easiest fix!
other solution, we would to double protect SDL_JoystickLock() and Unlock(), with also locking Android_ActivityMutex ...

@slouken
Copy link
Collaborator

slouken commented Jun 12, 2023

We should be protected against the case where the mutex is currently being held. It's supposed to destroy itself on the last unlock. Please back out your last change and let's figure out why this is happening?

@1bsyl
Copy link
Contributor Author

1bsyl commented Jun 12, 2023

yes, maybe:

void SDL_LockJoysticks(void)
{
    SDL_LockMutex(SDL_joystick_lock);
    ++SDL_joysticks_locked;

should be

void SDL_LockJoysticks(void)
{
    ++SDL_joysticks_locked;
    SDL_LockMutex(SDL_joystick_lock);

and also for Unlock

void SDL_UnlockJoysticks(void)
{
    SDL_UnlockMutex(SDL_joystick_lock);
  --SDL_joysticks_locked;

but there still could be a lock done just before SDL_DestroyMutex() ... so don't know

@slouken
Copy link
Collaborator

slouken commented Jun 12, 2023

Yeah, there's a huge set of race conditions here. Hmm...

@slouken
Copy link
Collaborator

slouken commented Jun 12, 2023

Okay, I have a fix that should work. It's not 100% perfect, but it minimizes the window where it could happen to a task switch between exactly two instructions.

slouken added a commit that referenced this issue Jun 12, 2023
Fixes #7811

(cherry picked from commit 6390165fd4c193631d6780758a4aeec0d02b90eb)
@AntTheAlchemist
Copy link
Contributor

AntTheAlchemist commented Jun 12, 2023

@1bsyl As a crash, no. I've had 1 Joystick related crash in the last 60 days, on a phone: [split_config.arm64_v8a.apk!libSDL3.so] HIDAPI_JoystickClose. My app will exit on PadUp(), though. All actions happen on a button release.

I am getting hundreds of SDL_LockMutex ANRs though, did you mean ANRs or crashes? There are many variations. Here's a few samples of this type of ANR which is specifically happening on TV devices (interesting to note that Google Play Console reports most of these happening with background visibility):

[split_config.armeabi_v7a.apk!libSDL3.so] SDL_LockMutex

TCL G07 (G07_4K_GB_NF) Android 11 (SDK 30)
"Signal Catcher" tid=3 Runnable
  #00  pc 0x000000000037ada1  /apex/com.android.art/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+76)
  #01  pc 0x000000000044c0a1  /apex/com.android.art/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+388)
  #02  pc 0x00000000004477e7  /apex/com.android.art/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+34)
  #03  pc 0x0000000000464c8d  /apex/com.android.art/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+688)
  #04  pc 0x000000000046014f  /apex/com.android.art/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+354)
  #05  pc 0x000000000045f647  /apex/com.android.art/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool)+1514)
  #06  pc 0x000000000045ed07  /apex/com.android.art/lib/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+638)
  #07  pc 0x0000000000416803  /apex/com.android.art/lib/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+130)
  #08  pc 0x00000000004269e9  /apex/com.android.art/lib/libart.so (art::SignalCatcher::HandleSigQuit()+1028)
  #09  pc 0x0000000000425d7f  /apex/com.android.art/lib/libart.so (art::SignalCatcher::Run(void*)+250)
  #10  pc 0x000000000008115f  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #11  pc 0x0000000000039f5d  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

"SDLActivity" tid=1 Native
  #00  pc 0x000000000003419c  /apex/com.android.runtime/lib/bionic/libc.so (syscall+28)
  #01  pc 0x00000000000392ff  /apex/com.android.runtime/lib/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+94)
  #02  pc 0x0000000000081d43  /apex/com.android.runtime/lib/bionic/libc.so (NonPI::MutexLockWithTimeout(pthread_mutex_internal_t*, bool, timespec const*)+414)
  #03  pc 0x00000000000648ab  /data/app/~~h7iDB2qdkZXvt-ALPhXA0Q==/uk.co.***.***-H4d1m0UeM-xuvty5zruZsg==/split_config.armeabi_v7a.apk!libSDL3.so (SDL_LockMutex+6)
  #04  pc 0x000000000004764b  /data/app/~~h7iDB2qdkZXvt-ALPhXA0Q==/uk.co.***.***-H4d1m0UeM-xuvty5zruZsg==/split_config.armeabi_v7a.apk!libSDL3.so (SDL_LockJoysticks+10)
  #05  pc 0x000000000004a441  /data/app/~~h7iDB2qdkZXvt-ALPhXA0Q==/uk.co.***.***-H4d1m0UeM-xuvty5zruZsg==/split_config.armeabi_v7a.apk!libSDL3.so
  at org.libsdl.app.SDLControllerManager.onNativePadUp (SDLControllerManager.java)
  at org.libsdl.app.SDLActivity.b (SDLActivity.java:47)
  at org.libsdl.app.SDLSurface.onKey (SDLSurface.java)
  at android.view.View.dispatchKeyEvent (View.java:14249)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1959)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1959)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1959)
  at com.android.internal.policy.DecorView.superDispatchKeyEvent (DecorView.java:476)
  at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent (PhoneWindow.java:1861)
  at android.app.Activity.dispatchKeyEvent (Activity.java:4085)
  at org.libsdl.app.SDLActivity.dispatchKeyEvent (SDLActivity.java)
  at com.android.internal.policy.DecorView.dispatchKeyEvent (DecorView.java:390)
  at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent (ViewRootImpl.java:6165)
  at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:6014)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5480)
  at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5537)
  at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5503)
  at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:5678)
  at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5511)
  at android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:5735)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5484)
  at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5537)
  at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5503)
  at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:5511)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:5484)
  at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:5537)
  at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:5503)
  at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:5711)
  at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent (ViewRootImpl.java:5869)
  at android.view.inputmethod.InputMethodManager$PendingEvent.run (InputMethodManager.java:3179)
  at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback (InputMethodManager.java:2721)
  at android.view.inputmethod.InputMethodManager.finishedInputEvent (InputMethodManager.java:2712)
  at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished (InputMethodManager.java:3156)
  at android.view.InputEventSender.dispatchInputEventFinished (InputEventSender.java:143)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:335)
  at android.os.Looper.loop (Looper.java:200)
  at android.app.ActivityThread.main (ActivityThread.java:7848)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:592)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1070)

"FinalizerDaemon" tid=7 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:442)
  at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:190)
  at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:211)
  at java.lang.Daemons$FinalizerDaemon.runInternal (Daemons.java:273)
  at java.lang.Daemons$Daemon.run (Daemons.java:139)
  at java.lang.Thread.run (Thread.java:923)

"Jit thread pool worker thread 0" tid=8 Native
  #00  pc 0x000000000003419c  /apex/com.android.runtime/lib/bionic/libc.so (syscall+28)
  #01  pc 0x0000000000131005  /apex/com.android.art/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+88)
  #02  pc 0x000000000046619f  /apex/com.android.art/lib/libart.so (art::ThreadPool::GetTask(art::Thread*)+54)
  #03  pc 0x00000000004658b9  /apex/com.android.art/lib/libart.so (art::ThreadPoolWorker::Run()+76)
  #04  pc 0x000000000046550b  /apex/com.android.art/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+114)
  #05  pc 0x000000000008115f  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #06  pc 0x0000000000039f5d  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

"HeapTaskDaemon" tid=9 Waiting
  #00  pc 0x00000000000341a0  /apex/com.android.runtime/lib/bionic/libc.so (syscall+32)
  #01  pc 0x00000000001312d9  /apex/com.android.art/lib/libart.so (art::ConditionVariable::TimedWait(art::Thread*, long long, int)+116)
  #02  pc 0x000000000021a00b  /apex/com.android.art/lib/libart.so (art::gc::TaskProcessor::GetTask(art::Thread*)+314)
  #03  pc 0x000000000021a72d  /apex/com.android.art/lib/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)+48)
  at dalvik.system.VMRuntime.runHeapTasks (Native method)
  at java.lang.Daemons$HeapTaskDaemon.runInternal (Daemons.java:531)
  at java.lang.Daemons$Daemon.run (Daemons.java:139)
  at java.lang.Thread.run (Thread.java:923)

"ReferenceQueueDaemon" tid=10 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:442)
  at java.lang.Object.wait (Object.java:568)
  at java.lang.Daemons$ReferenceQueueDaemon.runInternal (Daemons.java:217)
  at java.lang.Daemons$Daemon.run (Daemons.java:139)
  at java.lang.Thread.run (Thread.java:923)

"FinalizerWatchdogDaemon" tid=11 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:442)
  at java.lang.Object.wait (Object.java:568)
  at java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded (Daemons.java:341)
  at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal (Daemons.java:321)
  at java.lang.Daemons$Daemon.run (Daemons.java:139)
  at java.lang.Thread.run (Thread.java:923)

"Binder:1170_1" tid=12 Native
  #00  pc 0x0000000000071258  /apex/com.android.runtime/lib/bionic/libc.so (__ioctl+8)
  #01  pc 0x000000000003f2cb  /apex/com.android.runtime/lib/bionic/libc.so (ioctl+26)
  #02  pc 0x0000000000039c1b  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+238)
  #03  pc 0x0000000000039d75  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+8)
  #04  pc 0x000000000003a45b  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
  #05  pc 0x0000000000053ffd  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
  #06  pc 0x000000000000ed4b  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+170)
  #07  pc 0x000000000006d497  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+86)
  #08  pc 0x000000000000e889  /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+264)
  #09  pc 0x000000000008115f  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #10  pc 0x0000000000039f5d  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

"Binder:1170_2" tid=13 Native
  #00  pc 0x0000000000071258  /apex/com.android.runtime/lib/bionic/libc.so (__ioctl+8)
  #01  pc 0x000000000003f2cb  /apex/com.android.runtime/lib/bionic/libc.so (ioctl+26)
  #02  pc 0x0000000000039c1b  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+238)
  #03  pc 0x0000000000039d75  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+8)
  #04  pc 0x000000000003a45b  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
  #05  pc 0x0000000000053ffd  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
  #06  pc 0x000000000000ed4b  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+170)
  #07  pc 0x000000000006d497  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+86)
  #08  pc 0x000000000000e889  /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+264)
  #09  pc 0x000000000008115f  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #10  pc 0x0000000000039f5d  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

"Binder:1170_3" tid=14 Native
  #00  pc 0x0000000000071258  /apex/com.android.runtime/lib/bionic/libc.so (__ioctl+8)
  #01  pc 0x000000000003f2cb  /apex/com.android.runtime/lib/bionic/libc.so (ioctl+26)
  #02  pc 0x0000000000039c1b  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+238)
  #03  pc 0x0000000000039d75  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+8)
  #04  pc 0x000000000003a45b  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
  #05  pc 0x0000000000053ffd  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
  #06  pc 0x000000000000ed4b  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+170)
  #07  pc 0x000000000006d497  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+86)
  #08  pc 0x000000000000e889  /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+264)
  #09  pc 0x000000000008115f  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #10  pc 0x0000000000039f5d  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

"Profile Saver" tid=15 Native
  #00  pc 0x000000000003419c  /apex/com.android.runtime/lib/bionic/libc.so (syscall+28)
  #01  pc 0x0000000000131005  /apex/com.android.art/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+88)
  #02  pc 0x000000000026e1f7  /apex/com.android.art/lib/libart.so (art::ProfileSaver::Run()+494)
  #03  pc 0x0000000000271bd3  /apex/com.android.art/lib/libart.so (art::ProfileSaver::RunProfileSaverThread(void*)+106)
  #04  pc 0x000000000008115f  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #05  pc 0x0000000000039f5d  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

"WM.task-1" tid=16 Waiting
  at sun.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:923)

"bm" tid=17 Native
  #00  pc 0x0000000000072334  /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20)
  #01  pc 0x0000000000043d7d  /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16)
  #02  pc 0x0000000000011bb1  /system/lib/libutils.so (android::Looper::pollInner(int)+128)
  #03  pc 0x0000000000011ad7  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62)
  #04  pc 0x00000000000bb005  /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:335)
  at android.os.Looper.loop (Looper.java:200)
  at android.os.HandlerThread.run (HandlerThread.java:67)

"bc" tid=18 Native
  #00  pc 0x000000000003419c  /apex/com.android.runtime/lib/bionic/libc.so (syscall+28)
  #01  pc 0x0000000000131005  /apex/com.android.art/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+88)
  #02  pc 0x00000000004d91e3  /apex/com.android.art/lib/libart.so (art::GoToRunnable(art::Thread*)+342)
  #03  pc 0x00000000004d9065  /apex/com.android.art/lib/libart.so (art::JniMethodEnd(unsigned int, art::Thread*)+8)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:335)
  at android.os.Looper.loop (Looper.java:200)
  at android.os.HandlerThread.run (HandlerThread.java:67)

"RenderThread" tid=19 Native
  #00  pc 0x0000000000072334  /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20)
  #01  pc 0x0000000000043d7d  /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16)
  #02  pc 0x0000000000011bb1  /system/lib/libutils.so (android::Looper::pollInner(int)+128)
  #03  pc 0x0000000000011ad7  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62)
  #04  pc 0x00000000001431af  /system/lib/libhwui.so (android::uirenderer::ThreadBase::waitForWork()+86)
  #05  pc 0x000000000015ac8d  /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+52)
  #06  pc 0x000000000000ed4b  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+170)
  #07  pc 0x000000000000e889  /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+264)
  #08  pc 0x000000000008115f  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #09  pc 0x0000000000039f5d  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

"WM.task-2" tid=21 Waiting
  at sun.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:923)

"hwuiTask0" tid=22 Native
  #00  pc 0x000000000003419c  /apex/com.android.runtime/lib/bionic/libc.so (syscall+28)
  #01  pc 0x00000000000392ff  /apex/com.android.runtime/lib/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+94)
  #02  pc 0x00000000000807a3  /apex/com.android.runtime/lib/bionic/libc.so (pthread_cond_wait+32)
  #03  pc 0x000000000003d2f1  /system/lib/libc++.so (std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)+8)
  #04  pc 0x000000000015d273  /system/lib/libhwui.so (android::uirenderer::CommonPool::workerLoop()+70)
  #05  pc 0x000000000015d3f1  /system/lib/libhwui.so (void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, android::uirenderer::CommonPool::CommonPool()::$_0> >(void*)+88)
  #06  pc 0x000000000008115f  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #07  pc 0x0000000000039f5d  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

"hwuiTask1" tid=23 Native
  #00  pc 0x000000000003419c  /apex/com.android.runtime/lib/bionic/libc.so (syscall+28)
  #01  pc 0x00000000000392ff  /apex/com.android.runtime/lib/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+94)
  #02  pc 0x00000000000807a3  /apex/com.android.runtime/lib/bionic/libc.so (pthread_cond_wait+32)
  #03  pc 0x000000000003d2f1  /system/lib/libc++.so (std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)+8)
  #04  pc 0x000000000015d273  /system/lib/libhwui.so (android::uirenderer::CommonPool::workerLoop()+70)
  #05  pc 0x000000000015d3f1  /system/lib/libhwui.so (void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, android::uirenderer::CommonPool::CommonPool()::$_0> >(void*)+88)
  #06  pc 0x000000000008115f  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #07  pc 0x0000000000039f5d  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

"PlayBillingLibrary-1" tid=24 Waiting
  at sun.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:923)

"PlayBillingLibrary-2" tid=25 Waiting
  at sun.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:923)

"PlayBillingLibrary-3" tid=26 Waiting
  at sun.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:923)

"GmsDynamite" tid=29 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:442)
  at java.lang.Object.wait (Object.java:568)
  at com.google.android.gms.dynamite.zza.run (zza.java)

"ConnectivityThread" tid=32 Native
  #00  pc 0x0000000000072334  /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20)
  #01  pc 0x0000000000043d7d  /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16)
  #02  pc 0x0000000000011bb1  /system/lib/libutils.so (android::Looper::pollInner(int)+128)
  #03  pc 0x0000000000011ad7  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62)
  #04  pc 0x00000000000bb005  /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:335)
  at android.os.Looper.loop (Looper.java:200)
  at android.os.HandlerThread.run (HandlerThread.java:67)

"GoogleApiHandler" tid=34 Native
  #00  pc 0x0000000000072334  /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20)
  #01  pc 0x0000000000043d7d  /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16)
  #02  pc 0x0000000000011bb1  /system/lib/libutils.so (android::Looper::pollInner(int)+128)
  #03  pc 0x0000000000011ad7  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62)
  #04  pc 0x00000000000bb005  /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:335)
  at android.os.Looper.loop (Looper.java:200)
  at android.os.HandlerThread.run (HandlerThread.java:67)

"queued-work-looper" tid=35 Native
  #00  pc 0x0000000000072334  /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20)
  #01  pc 0x0000000000043d7d  /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16)
  #02  pc 0x0000000000011bb1  /system/lib/libutils.so (android::Looper::pollInner(int)+128)
  #03  pc 0x0000000000011ad7  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62)
  #04  pc 0x00000000000bb005  /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:335)
  at android.os.Looper.loop (Looper.java:200)
  at android.os.HandlerThread.run (HandlerThread.java:67)

"AdWorker(NG) #1" tid=38 Timed Waiting
  at sun.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:230)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:2109)
  at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take (ScheduledThreadPoolExecutor.java:1132)
  at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take (ScheduledThreadPoolExecutor.java:849)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:923)

"pool-6-thread-1" tid=39 Timed Waiting
  at sun.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:230)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:2109)
  at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take (ScheduledThreadPoolExecutor.java:1132)
  at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take (ScheduledThreadPoolExecutor.java:849)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:923)

"Chrome_ProcessLauncherThread" tid=41 Native
  #00  pc 0x0000000000072334  /apex/com.android.runtime/lib/bionic/libc.so (__epoll_pwait+20)
  #01  pc 0x0000000000043d7d  /apex/com.android.runtime/lib/bionic/libc.so (epoll_wait+16)
  #02  pc 0x0000000000011bb1  /system/lib/libutils.so (android::Looper::pollInner(int)+128)
  #03  pc 0x0000000000011ad7  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62)
  #04  pc 0x00000000000bb005  /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:335)
  at android.os.Looper.loop (Looper.java:200)
  at android.os.HandlerThread.run (HandlerThread.java:67)

"GoogleApiHandler" tid=43 Native
Metz shinagawa (METZ 2K TV) Android 9 (SDK 28)
"Signal Catcher" tid=3 Runnable
  #00  pc 0x00000000002e0297  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+134)
  #01  pc 0x0000000000377d3f  /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+210)
  #02  pc 0x000000000037435b  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+34)
  #03  pc 0x000000000038d673  /system/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+674)
  #04  pc 0x0000000000387879  /system/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+320)
  #05  pc 0x0000000000386f59  /system/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool)+792)
  #06  pc 0x0000000000386b6d  /system/lib/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char>>&)+652)
  #07  pc 0x0000000000360265  /system/lib/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char>>&)+120)
  #08  pc 0x000000000036971d  /system/lib/libart.so (art::SignalCatcher::HandleSigQuit()+1036)
  #09  pc 0x0000000000368893  /system/lib/libart.so (art::SignalCatcher::Run(void*)+250)
  #10  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #11  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

"SDLActivity" tid=1 Native
  #00  pc 0x0000000000019d54  /system/lib/libc.so (syscall+28)
  #01  pc 0x000000000001d125  /system/lib/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+88)
  #02  pc 0x0000000000064675  /system/lib/libc.so (NonPI::MutexLockWithTimeout(pthread_mutex_internal_t*, bool, timespec const*)+436)
  #03  pc 0x00000000000648ab  /data/app/uk.co.***.***-fXKws6J4TnySo0goaKAYZw==/split_config.armeabi_v7a.apk (SDL_LockMutex+6)
  #04  pc 0x000000000004764b  /data/app/uk.co.***.***-fXKws6J4TnySo0goaKAYZw==/split_config.armeabi_v7a.apk (SDL_LockJoysticks+10)
  #05  pc 0x000000000004a301  /data/app/uk.co.***.***-fXKws6J4TnySo0goaKAYZw==/split_config.armeabi_v7a.apk
  at org.libsdl.app.SDLControllerManager.onNativePadDown (SDLControllerManager.java)
  at org.libsdl.app.SDLActivity.b (SDLActivity.java:34)
  at org.libsdl.app.SDLSurface.onKey (SDLSurface.java)
  at android.view.View.dispatchKeyEvent (View.java:12446)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1896)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1896)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1896)
  at com.android.internal.policy.DecorView.superDispatchKeyEvent (DecorView.java:428)
  at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent (PhoneWindow.java:1820)
  at android.app.Activity.dispatchKeyEvent (Activity.java:3361)
  at org.libsdl.app.SDLActivity.dispatchKeyEvent (SDLActivity.java)
  at com.android.internal.policy.DecorView.dispatchKeyEvent (DecorView.java:342)
  at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent (ViewRootImpl.java:5042)
  at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:4910)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4431)
  at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:4484)
  at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:4450)
  at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:4590)
  at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:4458)
  at android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:4647)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4431)
  at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:4484)
  at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:4450)
  at android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:4458)
  at android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:4431)
  at android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:4484)
  at android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:4450)
  at android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:4623)
  at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent (ViewRootImpl.java:4784)
  at android.view.inputmethod.InputMethodManager$PendingEvent.run (InputMethodManager.java:2571)
  at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback (InputMethodManager.java:2081)
  at android.view.inputmethod.InputMethodManager.finishedInputEvent (InputMethodManager.java:2072)
  at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished (InputMethodManager.java:2548)
  at android.view.InputEventSender.dispatchInputEventFinished (InputEventSender.java:141)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:326)
  at android.os.Looper.loop (Looper.java:160)
  at android.app.ActivityThread.main (ActivityThread.java:6718)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:858)

"Jit thread pool worker thread 0" tid=2 Native
  #00  pc 0x0000000000019d54  /system/lib/libc.so (syscall+28)
  #01  pc 0x00000000000a6c63  /system/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+86)
  #02  pc 0x000000000038e85b  /system/lib/libart.so (art::ThreadPool::GetTask(art::Thread*)+170)
  #03  pc 0x000000000038e10f  /system/lib/libart.so (art::ThreadPoolWorker::Run()+62)
  #04  pc 0x000000000038dd45  /system/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+92)
  #05  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #06  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

"ReferenceQueueDaemon" tid=4 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Daemons$ReferenceQueueDaemon.runInternal (Daemons.java:178)
  at java.lang.Daemons$Daemon.run (Daemons.java:103)
  at java.lang.Thread.run (Thread.java:764)

"FinalizerDaemon" tid=5 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:422)
  at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:188)
  at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:209)
  at java.lang.Daemons$FinalizerDaemon.runInternal (Daemons.java:232)
  at java.lang.Daemons$Daemon.run (Daemons.java:103)
  at java.lang.Thread.run (Thread.java:764)

"FinalizerWatchdogDaemon" tid=6 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded (Daemons.java:297)
  at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal (Daemons.java:277)
  at java.lang.Daemons$Daemon.run (Daemons.java:103)
  at java.lang.Thread.run (Thread.java:764)

"HeapTaskDaemon" tid=7 Waiting
  #00  pc 0x0000000000019d54  /system/lib/libc.so (syscall+28)
  #01  pc 0x00000000000a6c63  /system/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+86)
  #02  pc 0x00000000001ac181  /system/lib/libart.so (art::gc::TaskProcessor::GetTask(art::Thread*)+304)
  #03  pc 0x00000000001ac7d5  /system/lib/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)+48)
  at dalvik.system.VMRuntime.runHeapTasks (Native method)
  at java.lang.Daemons$HeapTaskDaemon.runInternal (Daemons.java:475)
  at java.lang.Daemons$Daemon.run (Daemons.java:103)
  at java.lang.Thread.run (Thread.java:764)

"Binder:424_1" tid=8 Native
  #00  pc 0x0000000000053d50  /system/lib/libc.so (__ioctl+8)
  #01  pc 0x0000000000021b29  /system/lib/libc.so (ioctl+36)
  #02  pc 0x000000000003d57f  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+206)
  #03  pc 0x000000000003d6cb  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+10)
  #04  pc 0x000000000003dc53  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
  #05  pc 0x000000000005475d  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
  #06  pc 0x000000000000c117  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
  #07  pc 0x000000000006f153  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+82)
  #08  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #09  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

"Binder:424_2" tid=9 Native
  #00  pc 0x0000000000053d50  /system/lib/libc.so (__ioctl+8)
  #01  pc 0x0000000000021b29  /system/lib/libc.so (ioctl+36)
  #02  pc 0x000000000003d57f  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+206)
  #03  pc 0x000000000003d6cb  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+10)
  #04  pc 0x000000000003dc53  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
  #05  pc 0x000000000005475d  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
  #06  pc 0x000000000000c117  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
  #07  pc 0x000000000006f153  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+82)
  #08  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #09  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

"Binder:424_3" tid=10 Native
  #00  pc 0x0000000000053d50  /system/lib/libc.so (__ioctl+8)
  #01  pc 0x0000000000021b29  /system/lib/libc.so (ioctl+36)
  #02  pc 0x000000000003d57f  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+206)
  #03  pc 0x000000000003d6cb  /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+10)
  #04  pc 0x000000000003dc53  /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+38)
  #05  pc 0x000000000005475d  /system/lib/libbinder.so (android::PoolThread::threadLoop()+12)
  #06  pc 0x000000000000c117  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
  #07  pc 0x000000000006f153  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+82)
  #08  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #09  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

"Profile Saver" tid=11 Native
  #00  pc 0x0000000000019d54  /system/lib/libc.so (syscall+28)
  #01  pc 0x00000000000a6c63  /system/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+86)
  #02  pc 0x00000000002609e3  /system/lib/libart.so (art::ProfileSaver::Run()+362)
  #03  pc 0x00000000002632d5  /system/lib/libart.so (art::ProfileSaver::RunProfileSaverThread(void*)+52)
  #04  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #05  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

"WM.task-1" tid=12 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Thread.parkFor$ (Thread.java:2137)
  at sun.misc.Unsafe.park (Unsafe.java:358)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2059)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:764)

"WM.task-2" tid=13 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Thread.parkFor$ (Thread.java:2137)
  at sun.misc.Unsafe.park (Unsafe.java:358)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2059)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:764)

"RenderThread" tid=14 Native
  #00  pc 0x0000000000053c14  /system/lib/libc.so (__epoll_pwait+20)
  #01  pc 0x0000000000026059  /system/lib/libc.so (epoll_wait+16)
  #02  pc 0x000000000000f121  /system/lib/libutils.so (android::Looper::pollInner(int)+116)
  #03  pc 0x000000000000f02b  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+26)
  #04  pc 0x00000000000a39e3  /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+166)
  #05  pc 0x000000000000c117  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
  #06  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #07  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

"SDLThread" tid=15 Native
  #00  pc 0x0000000000053d50  /system/lib/libc.so (__ioctl+8)
  #01  pc 0x0000000000021b29  /system/lib/libc.so (ioctl+36)
  #02  pc 0x000000000003d57f  /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+206)
  #03  pc 0x000000000003df83  /system/lib/libbinder.so (android::IPCThreadState::waitForResponse(android::Parcel*, int*)+26)
  #04  pc 0x00000000000371d5  /system/lib/libbinder.so (android::BpBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+36)
  #05  pc 0x00000000000c3e4f  /system/lib/libandroid_runtime.so (android_os_BinderProxy_transact(_JNIEnv*, _jobject*, int, _jobject*, _jobject*, int)+82)
  at android.os.BinderProxy.transactNative (Native method)
  at android.os.BinderProxy.transact (Binder.java:1129)
  at android.hardware.usb.IUsbManager$Stub$Proxy.getDeviceList (IUsbManager.java:460)
  at android.hardware.usb.UsbManager.getDeviceList (UsbManager.java:387)
  at org.libsdl.app.HIDDeviceManager.initializeUSB (HIDDeviceManager.java:45)
  at org.libsdl.app.HIDDeviceManager.initialize (HIDDeviceManager.java:45)
  at org.libsdl.app.SDLActivity.nativeRunMain (SDLActivity.java)
  at org.libsdl.app.SDLMain.run (SDLMain.java:96)
  at java.lang.Thread.run (Thread.java:764)

"hwuiTask1" tid=16 Native
  #00  pc 0x0000000000019d54  /system/lib/libc.so (syscall+28)
  #01  pc 0x000000000001d125  /system/lib/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+88)
  #02  pc 0x0000000000063183  /system/lib/libc.so (pthread_cond_wait+32)
  #03  pc 0x00000000003440eb  /system/lib/libhwui.so (android::uirenderer::TaskManager::WorkerThread::threadLoop()+222)
  #04  pc 0x000000000000c18f  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+286)
  #05  pc 0x000000000006f153  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+82)
  #06  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #07  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

"PlayBillingLibrary-1" tid=17 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Thread.parkFor$ (Thread.java:2137)
  at sun.misc.Unsafe.park (Unsafe.java:358)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2059)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:764)

"PlayBillingLibrary-3" tid=18 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Thread.parkFor$ (Thread.java:2137)
  at sun.misc.Unsafe.park (Unsafe.java:358)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2059)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:764)

"PlayBillingLibrary-2" tid=19 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Thread.parkFor$ (Thread.java:2137)
  at sun.misc.Unsafe.park (Unsafe.java:358)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2059)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:764)

"queued-work-looper" tid=20 Native
  #00  pc 0x0000000000053c14  /system/lib/libc.so (__epoll_pwait+20)
  #01  pc 0x0000000000026059  /system/lib/libc.so (epoll_wait+16)
  #02  pc 0x000000000000f121  /system/lib/libutils.so (android::Looper::pollInner(int)+116)
  #03  pc 0x000000000000f02b  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+26)
  #04  pc 0x00000000000b893d  /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+26)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:326)
  at android.os.Looper.loop (Looper.java:160)
  at android.os.HandlerThread.run (HandlerThread.java:65)

"RenderThread" tid=459 Unknown
  #00  pc 0x0000000000053d50  /system/lib/libc.so (__ioctl+8)
  #01  pc 0x0000000000021b29  /system/lib/libc.so (ioctl+36)
  #02  pc 0x0000000000080530  /vendor/lib/egl/libGLES_mali.so (_mali_uku_wait_for_notification+44)
  #03  pc 0x00000000000834d0  /vendor/lib/egl/libGLES_mali.so (arch_worker_thread+300)
  #04  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #05  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

"POSIX timer 0" tid=460 Unknown
  #00  pc 0x0000000000053f44  /system/lib/libc.so (__rt_sigtimedwait+12)
  #01  pc 0x00000000000239e9  /system/lib/libc.so (__timer_thread_start(void*)+120)
  #02  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #03  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

"SDLThread" tid=463 Unknown
  #00  pc 0x0000000000019d54  /system/lib/libc.so (syscall+28)
  #01  pc 0x000000000001d125  /system/lib/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+88)
  #02  pc 0x0000000000063183  /system/lib/libc.so (pthread_cond_wait+32)
  #03  pc 0x000000000007fdec  /vendor/lib/egl/libGLES_mali.so (_mali_osu_lock_wait+96)
  #04  pc 0x0000000000077f88  /vendor/lib/egl/libGLES_mali.so (_mali_base_worker_thread+180)
  #05  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #06  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

"RenderThread" tid=695 Unknown
  #00  pc 0x0000000000019d54  /system/lib/libc.so (syscall+28)
  #01  pc 0x000000000001d125  /system/lib/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+88)
  #02  pc 0x0000000000063183  /system/lib/libc.so (pthread_cond_wait+32)
  #03  pc 0x000000000007fdec  /vendor/lib/egl/libGLES_mali.so (_mali_osu_lock_wait+96)
  #04  pc 0x0000000000077f88  /vendor/lib/egl/libGLES_mali.so (_mali_base_worker_thread+180)
  #05  pc 0x00000000000639e5  /system/lib/libc.so (__pthread_start(void*)+22)
  #06  pc 0x000000000001df75  /system/lib/libc.so (__start_thread+22)

@AntTheAlchemist
Copy link
Contributor

The collapsible blocks didn't come out at all well, sorry. I added backticks and it made it worse, how can I add summery text with code content?

@slouken
Copy link
Collaborator

slouken commented Jun 12, 2023

@AntTheAlchemist, can you create a new issue for these, so they don't get lost in the closed bug report?

@madebr
Copy link
Contributor

madebr commented Jun 12, 2023

The collapsible blocks didn't come out at all well, sorry. I added backticks and it made it worse, how can I add summery text with code content?

You need to add an empty line after </summary> and before the final </details>.
It's a quirk of GitHub's markdown parser, I guess.

@AntTheAlchemist
Copy link
Contributor

You need to add an empty line after </summary> and before the final </details>.

@madebr thank-you, that's good to know. Thanks for fixing my post.

@AntTheAlchemist, can you create a new issue for these, so they don't get lost in the closed bug report?

@slouken Yes, absolutely. Let me fist try out the very latest SDL3 source in a live test to see how well the recent fixes work, so I can come back with a fresh report. @1bsyl is waiting on some fresh logs as well. I won't forget. I have a bunch of other ANRs and Crashes I'll report in new issues soon - just want to make sure I can make them as useful as possible first.

@1bsyl
Copy link
Contributor Author

1bsyl commented Jun 13, 2023

first log:
1/ SDLActivity seems to be waiting for the JoystickLock (in OnPadUp)
Since it's waiting for the lock, it must have been created first. So SDLThread was existing.
But there are no SDLThread. So did it exit without releasing the JoystickLock() ? Eg C main() quits without calling SDL_JoystickUnlock() ? check you code to see you have all the necessary SDL_JoystickUnlock() in all situations ?

second log:
This crash looks strange. because there should be only 1 SDLThread. but there are tid=15 and tid=463.

SDLActivity is also waiting for the JoystickLock but in OnPadDown().

SDLThread tid=15
is waiting in UsbManager.getDeviceList()
called at org.libsdl.app.HIDDeviceManager.initializeUSB (HIDDeviceManager.java:45)
at org.libsdl.app.HIDDeviceManager.initialize (HIDDeviceManager.java:45)

This sounds something done at start of the app. Probably it has taken the JoystickLock somewhere for initialization, so this sounds fine that SDLActivity is waiting.
But maybe UsbManager.getDeviceList() just hangs, eg android bug (IPCThreadState::talkWithDriver && waitForResponse) ? or is waiting for a permission ?
So the SDLThread blocks directly at starts and then blocks the Activity.

SDLThread tid=463 no idea what it is doing :/
stack trace doesn't look like SDL. (--> I suggested to temporary append a timestamp to the SDLThread string name, just to see if we get 2 different names)
Who's created it ? SDLActivity before being blocked ? can have it been re-created because SDLThread=15 was hanged ?
could be a warm start, and we re-create the SDLThread, but then, why, don't we have the normal SDL stack trace starting from java.lang.Thread.run ?

1bsyl added a commit to 1bsyl/SDL that referenced this issue Jun 22, 2023
commit 4339113
Author: Sylvain <sylvain.becker@gmail.com>
Date:   Thu Jun 22 10:48:12 2023 +0200

    SDL_DBus_AppendDictWithKeyValue: allows several key/value for other PRs

commit 8aee690
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed Jun 21 18:42:25 2023 -0700

    Make sure we send update complete events for delayed guide buttons

commit 4c9fb3e
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed Jun 21 13:59:53 2023 -0700

    Added the events SDL_EVENT_JOYSTICK_UPDATE_COMPLETE and SDL_EVENT_GAMEPAD_UPDATE_COMPLETE

    This allows the application to tell when a joystick polling cycle is complete and can process state changes as a single atomic update. It is disabled by default, at least for now.

commit 808d83d
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed Jun 21 13:49:09 2023 -0700

    Allow specifying APP_PLATFORM and APP_ABI on the command line

commit 214d5da
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed Jun 21 12:14:50 2023 -0700

    Removed 100 ms hitch when querying third party Nintendo Switch controllers that don't respond to request for info

    Also take advantage of the fact that we know whether the device is connected over Bluetooth now.

commit 3694dab
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed Jun 21 10:28:45 2023 -0700

    Use default sensor calibration if we can't read it from the Nintendo Switch controller

    Fixes libsdl-org#7830

commit 6306ee9
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 20 09:33:59 2023 -0700

    List the available haptic devices in testhaptic

commit 8cf5dc9
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 20 09:18:19 2023 -0700

    Build on Android targeting the arm64-v8a architecture by default

    This speeds up iteration time and covers most customer devices

commit 5f3213e
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 20 08:40:30 2023 -0700

    Added support for gamepad sensor fusion with the Razer Kishi

commit 91198ba
Author: Simon McVittie <smcv@collabora.com>
Date:   Tue Jun 20 13:22:55 2023 +0100

    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.

    Mitigates: ValveSoftware/steam-for-linux#9605
    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 3ddbeab
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 20 01:17:44 2023 -0700

    Moved Android sensor event handling to a separate thread

    This makes it so you can interact with sensors on multiple threads, as long as only one thread initializes and cleans up the sensor subsystem.

    This also has the benefit that sensor data is available as soon as possible.

commit 329e1b8
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Mon Jun 19 19:42:01 2023 -0700

    Update the sensors before the joysticks so the gamepad code gets fresh sensor readings

commit 1a9c04e
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Mon Jun 19 19:41:20 2023 -0700

    Don't try to update the gamepad fusion sensors manually, instead rely on the normal update flow

commit 20ea351
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Mon Jun 19 16:17:34 2023 -0700

    Use a separate sensor watching function for gamepad events to avoid reliance on system sensor events and prevent a potential deadlock

commit 70e43c1
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Mon Jun 19 08:36:30 2023 -0700

    Added support for blitting SDL_PIXELFORMAT_INDEX1LSB

    Fixes libsdl-org#7844

    (cherry picked from commit a3d4fd7)

commit c6ee978
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sun Jun 18 12:19:54 2023 -0700

    Fixed DualSense controllers not being picked up by the HIDAPI driver

    The hidraw device may take additional time to get the correct permissions for us to open it. In my tests on Steam Deck hardware, this ranges between 5-8ms.

commit 4e81b4e
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sun Jun 18 12:19:43 2023 -0700

    Added SDL_HINT_VIDEO_X11_SCALING_FACTOR to allow overriding the content scale on X11 (thanks Andres!)

commit 210c135
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sun Jun 18 12:19:38 2023 -0700

    Implement SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED for X11

    To match the focus stealing prevention logic from windows/osx.

    I didn't implement SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN as there is no
    standard mechanism for us to do so. In most cases marking a window as OverrideRedirect
    will cause to not acquire focus when mapped. And in steam we are doing that when
    appropriate.

    I still left a note in X11_ShowWindow() regarding this behaviour.

commit 9351bf6
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sun Jun 18 12:19:22 2023 -0700

    Add handling for SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED and SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN on macOS

    - Cocoa_ShowWindow will order a window that is not being activated below the key window (if one exists) then set visible

    - Cocoa_RaiseWindow calls -[NSWindow orderFront:] without changing the key window

commit f168f9c
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 17 12:42:55 2023 -0700

    Added support for the GameSir G4 Pro

    We can't read device info or IMU calibration from this controller, and it has no gyro or accelerometer, but is otherwise perfectly functional.

commit b770644
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 17 09:46:46 2023 -0700

    Fixed building on older kernel headers

commit b98494a
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 17 09:39:50 2023 -0700

    Fixed building on older kernel headers

commit 9fe384b
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 17 09:28:27 2023 -0700

    Fixed display orientation function names for SDL 3.0 convention

commit d91e96e
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 17 08:59:52 2023 -0700

    Use SDL_HINT_GAMECONTROLLER_SENSOR_FUSION as a list of controllers to enable sensor fusion

    There are too many wraparound style controllers out there to enumerate them all, so instead make this a user option in applications that support it.

commit 610c31c
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 17 08:28:37 2023 -0700

    Generalized the sensor coordinate transform for wraparound gamepads

commit 9eb5eab
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 17 08:04:34 2023 -0700

    Use the correct orientation transformation based on whether the device is naturally landscape or portrait

commit e6d1ba2
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 17 00:52:40 2023 -0700

    Added the concept of display natural orientation

    Also renamed SDL_GetDisplayOrientation() SDL_GetDisplayCurrentOrientation()

    The natural orientation of the primary display is the frame of reference for accelerometer and gyro sensor readings.

commit 8de6ce7
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 16 17:48:34 2023 -0700

    Rotate the sensor axes to match gamepad orientation when using the device sensors for game controllers

commit a9c86e5
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 16 17:48:18 2023 -0700

    Added the Razer Edge controller to the list of wraparound controllers

commit c207cd3
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 16 16:03:55 2023 -0700

    Added the Razer Junglecat to the wraparound controller list

commit e4f53e6
Author: Ozkan Sezer <sezeroz@gmail.com>
Date:   Sat Jun 17 01:01:10 2023 +0300

    testevdev.c:  comment out two unused data to fix build.

commit 42e4639
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed Jun 14 22:03:44 2023 -0700

    For gamepads that don't have their own sensors, try to use the system sensors.

    This allows using the gyro and accelerometer in handheld devices in conjunction with built-in or wraparound controllers.

commit d584592
Author: Simon McVittie <smcv@collabora.com>
Date:   Fri Jun 16 15:16:44 2023 +0100

    linux: If the kernel specifically tells us the device type, trust it

    If a device is positively identified as an accelerometer, pointing stick
    or clickpad, then we don't need to second-guess it.

    In practice this does not change the result for any device in our
    test data, so add some artificial records that exercise this.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 0d5aa70
Author: Simon McVittie <smcv@collabora.com>
Date:   Fri Jun 16 15:14:33 2023 +0100

    linux: Pass evdev properties when guessing device type

    In newer kernels, devices that can be positively identified as a
    particular device type (for example accelerometers) get a property
    bit set. Plumb this information through into the function, but don't
    use it for anything just yet.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit a4ce721
Author: Simon McVittie <smcv@collabora.com>
Date:   Fri Jun 16 15:15:31 2023 +0100

    testevdev: Allow device properties to be fully populated

    The props array was too small for the highest property bits to be set,
    although in practice this didn't matter since only the lower-order bits
    have a meaning. Make it consistent with all the others.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit fa0ca3d
Author: Simon McVittie <smcv@collabora.com>
Date:   Fri Jun 16 14:53:29 2023 +0100

    linux: Distinguish between "device with keys" and a full keyboard

    udev distinguishes between ID_INPUT_KEY, a device with any keyboard keys
    at all (including for example USB numeric keypads, Bluetooth headsets
    with volume control buttons, and some game controllers; and
    ID_INPUT_KEYBOARD, a reasonably fully-featured keyboard that you could
    use for general-purpose text entry. If we do the same here, then it's
    useful input to our heuristics for identifying devices: for example,
    a device with ID_INPUT_KEY could reasonably be a gamepad, but a device
    with ID_INPUT_KEYBOARD certainly isn't.

    Resolves: libsdl-org#7827
    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 9b7a9ca
Author: Simon McVittie <smcv@collabora.com>
Date:   Fri Jun 16 14:29:53 2023 +0100

    testevdev: Add some more laptop built-in devices

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 00b6db6
Author: Simon McVittie <smcv@collabora.com>
Date:   Fri Jun 16 14:29:41 2023 +0100

    testevdev: Add some EVIOCGNAME and USB name strings to test data

    We don't currently use these for anything, but we might start using
    them as input to our heuristics as part of libsdl-org#7697.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 3772d6c
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 15 19:46:35 2023 +0100

    testevdev: Add raw HID report descriptors where available

    We don't currently use these in our device-classification heuristic,
    but it could be a useful input in future.

    Thanks to Sam Lantinga, Ben Fradella, kevenwyld and schlegp for
    providing some of these.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 2b7556f
Author: Simon McVittie <smcv@collabora.com>
Date:   Fri Jun 16 14:35:16 2023 +0100

    testevdev: Correct typo in bus type for Xbox Series S|X via Bluetooth

    All Bluetooth devices are bus type 0x0005.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit c13e511
Author: Simon McVittie <smcv@collabora.com>
Date:   Tue Jun 13 17:48:50 2023 +0100

    testevdev: Try to correct Wii devices guessed from kernel source

    The comments here disagreed with the actual bytes. According to
    https://elixir.bootlin.com/linux/v6.3.7/source/drivers/hid/hid-wiimote-modules.c,
    the Balance Board reports BTN_A and ABS_HAT0X, HAT0Y, HAT1X and HAT1Y.
    This means the comments here were correct, but the .abs bits shown
    were in the wrong byte.

    Matching the Wii U Pro Controller against the same kernel source, it
    appears to be correct: it's the same representation as a PS3 gamepad,
    except that it lacks the Z and RZ axes for analogue triggers.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit ffdafcd
Author: Simon McVittie <smcv@collabora.com>
Date:   Tue Jun 13 17:26:51 2023 +0100

    testevdev: Verify most Wii devices against real hardware

    Some of the test data previously seen here was guessed from kernel
    source code, and not all of it was correct. The following devices have
    now been verified against `evemu-describe` output with Linux 6.3
    (thanks to Jeremy Whiting for collecting this):

    - basic Wiimote
        - buttons
        - 3-axis accelerometer
        - infra-red sensor for Sensor Bar location (precise aim)
    - Motion Plus accessory (3-axis gyroscope)
    - Nunchuck accessory (joystick, 2 buttons, second 3-axis accelerometer)
    - Classic Controller accessory (a complete traditional gamepad)

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 739f783
Author: SDL Wiki Bot <icculus-sdlwikibot@icculus.org>
Date:   Fri Jun 16 12:22:18 2023 +0000

    Sync SDL3 wiki -> header

commit 26df689
Author: Anonymous Maarten <anonymous.maarten@gmail.com>
Date:   Fri Jun 16 14:21:33 2023 +0200

    docs: expand CMake documentation + add minimal CMake project for reporting issues

commit 378e33b
Author: Sylvain <sylvain.becker@gmail.com>
Date:   Fri Jun 16 10:05:58 2023 +0200

    Android: potential ANR during onKeyDown/Up
    SDLActivity may call onNativeKeyDown, while application is quitting

commit e72935a
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Thu Jun 15 16:43:35 2023 -0700

    Check for modff in addition to modf

commit dab4f29
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Thu Jun 15 16:43:22 2023 -0700

    Cleanup spacing

commit 16b57d2
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 15 19:25:23 2023 +0100

    testevdev: Add details of another driving simulator controller

    Thanks to Ben Fradella.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 2b00751
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 15 15:50:03 2023 +0100

    testevdev: Expand test data for X-Box One Elite 2

    This slightly newer device than the one from libsdl-org#7814 is functionally
    equivalent when connected via USB. When connected via Bluetooth, it has
    a different button mapping.

    Thanks to Sam Lantinga.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 62ed6f4
Author: Mathieu Eyraud <70028899+meyraud705@users.noreply.github.com>
Date:   Thu Jun 15 09:59:07 2023 +0200

    Use SDL_strdup instead of strdup

commit 73927b0
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed Jun 14 15:16:21 2023 -0700

    Removed unused function

commit 2e465ae
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed Jun 14 11:05:10 2023 -0700

    Revert "Added SDL_nextafter() and SDL_nextafterf()"

    This reverts commit bc5d074.

    It's not clear that we need these yet, so I'm going to remove them for now.

commit 0c16f4f
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed Jun 14 10:15:06 2023 -0700

    Fixed third-party Nintendo Switch Pro controllers shutting down when we try to set the home LED.

    This fixes the PDP Afterglow Wireless Deluxe Controller.

commit 23e007d
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed Jun 14 00:02:32 2023 -0700

    Fixed third party Nintendo Switch Pro Controller resetting when being sent an unsupported command to set the Home LED

    Tested with the PowerA Fusion Pro Wireless Controller in Bluetooth mode

commit 8c95bd8
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 13 22:40:51 2023 -0700

    Allow switching licensed Nintendo Switch Pro controllers into gyro input mode

commit cdfc0c5
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 13 22:20:58 2023 -0700

    Added support for the PowerA Fusion Pro Wireless Controller in Bluetooth mode

    This controller shows up with a VID/PID of 0, but has full functionality over Bluetooth

commit 0f4b15e
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 13 16:53:10 2023 -0700

    Removed more Linux Xbox mappings in favor of the automatic mapping

    This fixes the Xbox Series X share button on Linux 5.x kernels.

commit 883b0f4
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 13 16:49:33 2023 -0700

    Cleanup for previous change, fixing typos, etc.

commit 9567989
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 13 16:41:52 2023 -0700

    Use the automatic mapping instead of a hardcoded one for Xbox controllers on Linux

    This is much more robust and able to dynamically create a mapping for Xbox One S, Xbox Series X, and Xbox Elite 2 controllers.

commit db1d4d3
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 13 16:40:30 2023 -0700

    Added automatic mapping support for Xbox controllers on the 6.x Linux kernels

    This automatically adds support for the share button and paddles when present.

commit 0f24956
Author: Sylvain <sylvain.becker@gmail.com>
Date:   Tue Jun 13 23:10:29 2023 +0200

    testautomation_hints.c: free hint memory

commit 2c37178
Author: Sylvain <sylvain.becker@gmail.com>
Date:   Tue Jun 13 23:00:00 2023 +0200

    testautomation_events.c: initialize "timestamp" to solve "conditional jump or move depends on uninitialised value"

commit 56ba7f2
Author: Simon McVittie <smcv@collabora.com>
Date:   Tue Jun 13 16:53:56 2023 +0100

    testevdev: Add details of X-Box One Elite 2 via USB

    Thanks to iacore for capturing these.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 7448451
Author: Simon McVittie <smcv@collabora.com>
Date:   Tue Jun 13 16:47:56 2023 +0100

    testevdev: Provide a pointer to more information about adding test-cases

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit bc5d074
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 13 07:34:50 2023 -0700

    Added SDL_nextafter() and SDL_nextafterf()

commit b0677f4
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 13 10:06:36 2023 -0700

    Added automatic mapping for Xbox Elite paddles using the xpadneo driver

    We can't actually tell yet whether a controller has paddles, so this code isn't effective, but I'll file an upstream issue and see if we can get that resolved.

commit 071d1e2
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 13 10:05:19 2023 -0700

    Fixed joystick vendor detection in Linux automatic gamepad mapping

commit 5a62a45
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 3 23:55:56 2023 -0700

    Fixed building with the 16.1.4479499 Android toolchain

    (cherry picked from commit b9d1c48)

commit cf1dc66
Author: Simon McVittie <smcv@collabora.com>
Date:   Fri Jun 9 13:24:21 2023 +0100

    linux: Improve gamepad mapping heuristic to accept Android conventions

    This heuristic for gamepads without a more specific mapping already
    tried two incompatible conventions for handling triggers: the Linux
    Gamepad Specification uses hat switch 2 for the triggers (for whatever
    reason), but the de facto standard set by the drivers for older Xbox
    and Playstation controllers represents each trigger as the Z-axis of
    the nearest analog stick.

    Android documentation encourages Bluetooth gamepad manufacturers to use
    a third incompatible convention where the left and right triggers are
    represented as the brake and gas pedals of a driving simulator
    controller. The Android convention also changes the representation of
    the right stick: instead of using X and Y rotation as a second pair
    of axes, Android uses Z position as a second horizontal axis, and
    Z rotation as a second vertical axis.

    Try to cope gracefully with all of these. This will hopefully resolve
    the issue described in libsdl-org#5406 (when using unpatched kernels).

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit c4d49fa
Author: Simon McVittie <smcv@collabora.com>
Date:   Fri Jun 9 13:06:30 2023 +0100

    linux: Reduce magic numbers when mapping gamepad axes

    The bitfield `mapped` has two different sets of meanings, depending
    whether we're setting up the triggers or the d-pad. Represent them
    as symbolic constants rather than opaque integers.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit dec0dbf
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Mon Jun 12 16:57:41 2023 -0700

    Fixed enumerating Steam Controllers on iOS

commit d95dbe7
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Mon Jun 12 15:39:57 2023 -0700

    Fixed n3ds build

commit cdc40ee
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Mon Jun 12 15:26:34 2023 -0700

    Reduce the chance of destroying the joystick mutex while it's in use

    Fixes libsdl-org#7811

commit 6ab846b
Author: Linus Probert <linus.probert@gmail.com>
Date:   Mon Jun 12 18:27:40 2023 +0200

    clipboard: Fixes additional x11 clipboard bugs found in tests

commit a2ba5e9
Author: Linus Probert <linus.probert@gmail.com>
Date:   Mon Jun 12 13:06:16 2023 +0200

    clipboard: Fixes testautomation fails introduced by clipboard changes

commit 4e0f94e
Author: Sylvain <sylvain.becker@gmail.com>
Date:   Mon Jun 12 11:45:46 2023 +0200

    Android: add timeout when waiting the SDL thread to finish

    C SDLmain() thread might have started (mSDLThread.start() called)
    while the SDL_Init() might not have been called yet,
    and so the previous QUIT event will be discarded by SDL_Init() and app is running, not exiting.

    This is reprocible by adding instrumentation code in the SDLActivity.

    And hopefully, this could fix an ANR, where SDLActivity is in WAITING state (in thread.join()):
      at java.lang.Thread.join (Thread.java:1519)
      at org.libsdl.app.SDLActivity.onDestroy (SDLActivity.java)

    while SDLThread seems to be running

commit 125e742
Author: Ryan C. Gordon <icculus@icculus.org>
Date:   Sun Jun 11 12:43:47 2023 -0400

    cocoa: Warp mouse to center of window before enabling relative mouse.

    This prevents the case where the mouse might be at the edge of the
    window when enabling relative mode, which confuses macOS, at it
    might believe the user is attempting to resize the window.

    Fixes libsdl-org#6994.

    (cherry picked from commit 2afb49b)

commit 4cfacd5
Author: Ozkan Sezer <sezeroz@gmail.com>
Date:   Sat Jun 10 20:50:02 2023 +0300

    SDL_dynapi.c: minor cosmetics.

commit 0103ec1
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 10 08:43:43 2023 -0700

    Fixed accidental commit

commit 7f86415
Author: SDL Wiki Bot <icculus-sdlwikibot@icculus.org>
Date:   Sat Jun 10 15:42:15 2023 +0000

    Sync SDL3 wiki -> header

commit 281018f
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 10 08:39:20 2023 -0700

    Make it clear that you can't mix 2D rendering and the window surface API

    Also added functions to query and destroy the window surface so you can switch between modes if you want.

    See pygame-community/pygame-ce#2190 for more details.

commit 5490873
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 9 18:41:21 2023 -0700

    Fixed querying device info on the MOBAPAD M073

    The query packet needs to contain valid rumble data in order to be accepted by the controller.

    Fixes libsdl-org#7788

commit 2042e9c
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 9 17:34:12 2023 -0700

    Only update the serial number if it hasn't already been set

    This fixes the serial number for Nintendo Switch Pro, which is queried from the hardware in device initialization, and was later clobbered by the USB string which isn't correct.

commit c8051b1
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 9 14:34:59 2023 -0700

    Fixed reading input from the Razer Atrox Arcade Stick using Windows Gaming Input

commit aaccf3c
Author: Sylvain <sylvain.becker@gmail.com>
Date:   Fri Jun 9 14:21:17 2023 +0200

    X11: common function to wait for the WM before sending SDL Window events

commit 8096f72
Author: Sylvain <sylvain.becker@gmail.com>
Date:   Fri Jun 9 09:41:54 2023 +0200

    Android: add robustness. check that the native code is run for the first time.

commit ae9d8ac
Author: Sylvain <sylvain.becker@gmail.com>
Date:   Fri Jun 9 09:27:39 2023 +0200

    Android: when an EventFilter is binded to SDL_EVENT_DID_ENTER_FOREGROUND event and triggered, GL context is expected to be already restored.

commit 4c0758a
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Thu Jun 8 12:39:32 2023 -0700

    Fixed crash if display couldn't be found in SDL_UpdateFullscreenMode()

commit d9c17e7
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 8 18:24:09 2023 +0100

    testevdev: Add details of some more 8BitDo devices

    Thanks to Jeremy Whiting.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit a2ed083
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 8 17:30:30 2023 +0100

    testevdev: Describe several equivalent devices

    ValveSoftware/steam-devices#34 lists several
    more devices that are functionally equivalent to this one from the
    point of view of their evdev metadata. Thanks to apgrc.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit f4a53e7
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 8 15:13:38 2023 +0100

    testevdev: Add test data for a DualSense (PS5) gamepad

    Also make details of PS4 gamepads (which are very similar from an evdev
    point of view) more specific.

    Thanks to Sam Lantinga and Jeremy Whiting for recording these.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 2fb1df1
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 8 16:00:27 2023 +0100

    testevdev: Add test data for Nintendo Switch Joy-Cons via Bluetooth

    Thanks to Jeremy Whiting.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 8a82e06
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 8 15:51:10 2023 +0100

    testevdev: Add test data for Microsoft Xbox Series S|X Controller

    Like the Stadia controller, this is unusual because it represents the
    Share button as the Record key from a multimedia keyboard (as of Linux
    6.2.11 with the xpad driver). Thanks to Jeremy Whiting.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit ff01b43
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 8 15:48:46 2023 +0100

    testevdev: Add Google Stadia controller

    This is a bit unusual because it has a small number of what would
    ordinarily be keyboard keys. Thanks to Jeremy Whiting for recording
    this.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 9ad0b8b
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 8 15:47:50 2023 +0100

    testevdev: Add test data for another Switch Pro Controller

    A newer evemu-describe transcript has this same controller with its
    buttons mapped differently, presumably a result of driver changes in
    the Linux kernel. Either way, we should recognise it as a gamepad.
    Thanks to Jeremy Whiting.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 7b526d0
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 8 15:46:52 2023 +0100

    testevdev: Finish incomplete data for Switch Pro Controller via USB

    This didn't include any buttons, which I assume was because I
    transcribed them incorrectly rather than reflecting reality. Confirmed
    against another Switch Pro Controller on a more recent kernel (thanks
    to Jeremy Whiting).

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 4c33ef9
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 8 15:45:17 2023 +0100

    testevdev: Note a functionally-equivalent device

    We don't need to re-test the heuristic with the same input data, but
    knowing that another device has equivalent evdev metadata is useful
    information to record. Thanks to Jeremy Whiting.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 4c035dc
Author: Simon McVittie <smcv@collabora.com>
Date:   Thu Jun 8 15:14:19 2023 +0100

    testevdev: Add another laptop touchpad

    This was reported by Rémi Bernon as an example of older SDL's non-udev
    code path going wrong for touchpads when the invoking user happens to
    be in the input group, which I believe was fixed by fdd945f.

    Signed-off-by: Simon McVittie <smcv@collabora.com>

commit 32d015a
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Thu Jun 8 10:46:56 2023 -0700

    Fixed PS3 controller initialization over Bluetooth

    Now that we have hidapi that knows whether the controller is connected via Bluetooth or USB, this is much easier to fix.

commit e15da19
Author: Frank Praznik <frank.praznik@gmail.com>
Date:   Wed Jun 7 15:04:49 2023 -0400

    video: Apply cleared flag states when restoring hidden windows

    Hiding a window and then clearing the minimized, maximized, fullscreen, or grabbed flags wouldn't result in the new state being applied to the window when shown, as the pending flags would always be zero, resulting in the flag application function never being entered. Calling SDL_RestoreWindow() didn't result in the minimized or maximized state being cleared on the hidden window either.

    Save the current window flags to the pending flags when hiding a window, and universally apply the pending flags when the window is shown again to ensure that all state that was set or cleared when the window was hidden is applied. Any pending flags that match the existing window flags will be automatically deduplicated by the corresponding functions.

commit 49b5cfa
Author: Ryan C. Gordon <icculus@icculus.org>
Date:   Wed Jun 7 15:42:22 2023 -0400

    x11: check if window size/position has changed during SDL_ShowWindow.

    Fixes libsdl-org#4216.

commit dc06116
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Jun 6 12:33:48 2023 -0700

    Steam sets the device version of the Steam Virtual Gamepad to 0, for the best compatibility with old games

commit d032492
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Mon Jun 5 21:28:12 2023 -0700

    Fixed detecting Bluetooth Steam Controllers on Windows

commit 17c397f
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Mon Jun 5 21:18:49 2023 -0700

    Save the error code before doing any other operation

    SDL_ClearError() resets the Win32 error code to 0

commit 6e7769c
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Mon Jun 5 18:02:37 2023 -0700

    Fixed detecting Bluetooth Steam Controllers

commit 6150b5b
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sun Jun 4 05:37:06 2023 -0700

    Don't bother re-encoding Latin1 characters in the ASCII range

commit 491ae20
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sun Jun 4 02:06:52 2023 -0700

    Only convert the result of XLookupString() if it's not already UTF-8

    Fixes libsdl-org#7766

commit c369b90
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sun Jun 4 01:01:06 2023 -0700

    Fixed SDL_iconv_string() truncation when handling SDL_ICONV_E2BIG

commit d406951
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 3 23:24:21 2023 -0700

    Cleaned up Alt-Enter/Ctrl-Enter fullscreen toggle logic

    Alt-Enter will go from the current state to fullscreen desktop, or if already there, will leave fullscreen mode.
    Ctrl-Enter will go from the current state to exclusive fullscreen mode, or if already there, will leave fullscreen mode.

commit 052a9d3
Author: Rusty Moyher <rustym@gmail.com>
Date:   Fri Jun 2 11:45:21 2023 -0500

    macOS: Removed the fullscreen blanking window

    - Removed the blanking window used in SDL_WINDOW_FULLSCREEN. This allows CMD + Tab to work.
    - Changed the fullscreen NSWindow level so this works properly.

    Fixes issue libsdl-org#7776

commit fa41ece
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 3 11:53:36 2023 -0700

    Allow other applications to open controllers on macOS

commit 6815e75
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 3 11:39:03 2023 -0700

    Steam uses a different VID/PID for the Steam Virtual Gamepad on Windows

commit 5f00147
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sat Jun 3 11:35:27 2023 -0700

    Revert "Fixed detection of the Steam Virtual Gamepad on macOS"

    This reverts commit 5fcd705.

    Steam has been updated to send a version of 1 to avoid conflicts with controllers that report a version of 0.

commit 0c862d9
Author: Ozkan Sezer <sezeroz@gmail.com>
Date:   Sat Jun 3 17:23:40 2023 +0300

    added compiler support comment about #pragma push_macro/pop_macro.

commit 5fcd705
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 2 18:37:45 2023 -0700

    Fixed detection of the Steam Virtual Gamepad on macOS

commit 9837653
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 2 15:52:56 2023 -0700

    Allow the application to send commands to Nintendo Switch controllers

commit 7c55845
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 2 11:20:31 2023 -0700

    Fixed build if SDL_JOYSTICK_RAWINPUT_MATCHING isn't enabled

commit 767507f
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 2 11:16:07 2023 -0700

    Don't use raw input while Remote Desktop is active

    Raw input will not send game controller events while Remote Desktop is active, so dynamically switch between XInput and raw input when Remote Desktop state changes.

    Fixes libsdl-org#7759

commit a5a1844
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 2 10:20:29 2023 -0700

    Fixed build error

commit e8b5b48
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 2 09:38:18 2023 -0700

    Fixed WGI immediately being correlated with raw input devices with no input

    The at rest match state is 0x0000008800000000, not 0

commit 2e27812
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Fri Jun 2 08:51:47 2023 -0700

    Fixed event sequence when Remote Desktop connects and disconnects

    1. Send display disconnected events for all displays no longer connected
    2. Send display connected events for all displays that have been connected
    3. Send window display events for any windows that have changed displays

commit 6aaf032
Author: Alibek Omarov <a1ba.omarov@gmail.com>
Date:   Fri Jun 2 05:55:42 2023 +0300

    wayland: reset orientation bitmask before reading values from hint on QtWayland

    Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
    (cherry picked from commit 68e3e99)

commit 5652037
Author: Alibek Omarov <a1ba.omarov@gmail.com>
Date:   Fri Jun 2 05:59:06 2023 +0300

    hints: clarify support for comma-separated values for QtWayland orientation that's available since 2.0.22

    Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
    (cherry picked from commit c395240)

commit 8c476ca
Author: Ozkan Sezer <sezeroz@gmail.com>
Date:   Fri Jun 2 14:56:40 2023 +0300

    hidapi/libusb: need libusb >= 1.0.16 because of libusb_get_port_numbers

commit e27c10a
Author: Ozkan Sezer <sezeroz@gmail.com>
Date:   Fri Jun 2 14:55:24 2023 +0300

    hidapi/libusb: don't try to dlsym libusb_wrap_sys_device

    not used in SDL.

commit 3ecdbf2
Author: Ozkan Sezer <sezeroz@gmail.com>
Date:   Fri Jun 2 14:36:14 2023 +0300

    hidapi: silence redefinition warnings

commit f082c68
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Thu Jun 1 10:48:15 2023 -0700

    Updated with upstream suggestions in libusb/hidapi#582

commit 0ad089d
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Thu Jun 1 08:30:10 2023 -0700

    Backed out local changes to build with libusb on Windows

commit b36679b
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Thu Jun 1 08:27:56 2023 -0700

    Updated with upstream suggestions in libusb/hidapi#582

commit 20182ee
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Thu Jun 1 07:47:28 2023 -0700

    Updated with upstream suggestions in libusb/hidapi#572

commit 0cff44d
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Thu Jun 1 07:27:51 2023 -0700

    Updated with upstream suggestions in libusb/hidapi#577

commit 4f58445
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed May 31 14:28:50 2023 -0700

    Ignore both the mouse and keyboard endpoints of Steam Controllers when enumerating game controllers

commit c886e80
Author: Nikita Krapivin <alienoom@yandex.ru>
Date:   Thu Jun 1 01:09:34 2023 +0500

    gdk: Virtual keyboard and text input backend

commit b6a88b0
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed May 31 10:49:46 2023 -0700

    Don't try to interpret Xbox controllers as raw HID devices on Windows

    These generate fake reports which don't include separate trigger axes, and the HIDAPI joystick driver doesn't understand this report format.

commit adad651
Author: Frank Praznik <frank.praznik@gmail.com>
Date:   Mon May 15 11:37:43 2023 -0400

    wayland: Add aspect-correct output for scaled modes

    Add aspect-correct output of scaled video modes and a hint to control this behavior (aspect, stretch, or none).

    The Wayland spec states that fullscreen surfaces that do not cover the entire output shall be centered with the borders masked by the compositor, so no additional work is required aside from calculating the proper window dimensions.

    The default is still 'stretch' mode, as some window managers as of this time (KDE and older versions of GNOME still found in LTS distros) don't behave according to the spec and present an unmasked window that is not centered, so it's not yet safe to change the default.

commit 4644ac9
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Wed May 31 08:27:27 2023 -0700

    Remove unneeded property type check

commit cddcc4f
Author: Wohlstand <admin@wohlnet.ru>
Date:   Wed May 31 03:54:38 2023 +0300

    Don't ignore "build-scripts"

commit 8e0b473
Author: Wohlstand <admin@wohlnet.ru>
Date:   Wed May 31 03:38:25 2023 +0300

    Also ignore "build-*/" sub-directories

    Locally, I do make multiple build directories for various purposes, like "build-debug", "build-release", "build-novideo", etc. Also, Qt Creator (if configure it) may automatically create build directories that always starts with a "build-*" prefix.

commit e9e4a91
Author: Ozkan Sezer <sezeroz@gmail.com>
Date:   Wed May 31 04:50:02 2023 +0300

    testautomation_guid.c: fix integer warning in 32 bit builds.

commit 0b28cbe
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue May 30 16:36:13 2023 -0700

    Allow building on really old Linux kernels (thanks @sezero!)

commit 9b147eb
Author: Ozkan Sezer <sezeroz@gmail.com>
Date:   Wed May 31 01:55:50 2023 +0300

    SDL_x11window.c: apply missing SDL2-to-SDL3 portage to fix build.

commit c521e12
Author: Ozkan Sezer <sezeroz@gmail.com>
Date:   Wed May 31 01:55:40 2023 +0300

    SDL_dbus.h: define DBUS_TIMEOUT_USE_DEFAULT if not already defined.

commit 20dfb7d
Author: Ozkan Sezer <sezeroz@gmail.com>
Date:   Wed May 31 01:55:40 2023 +0300

    hidapi/linux/hid.c: define BUS_SPI if not already defined.

commit 19c10b4
Author: Ryan C. Gordon <icculus@icculus.org>
Date:   Tue May 30 17:04:31 2023 -0400

    x11: Attempt to wait for SDL_MaximizeWindow to complete before returning.

    Fixes libsdl-org#7070.

    (cherry picked from commit 379a6f4)

commit 1fdcb61
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue May 30 05:52:07 2023 -0700

    Fixed build

commit 4c36726
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Mon May 29 16:44:17 2023 -0700

    macOS child window fixes

    - Fix places working with window coordinates that need to call SDL_RelativeToGlobalForWindow or SDL_GlobalToRelativeForWindow

    - Remove NSScreen param from ConvertNSRect(). Reflecting the Y coordinate is done relative to the main screen height (which ConvertNSRect
      was already doing) so the explicit screen isn't needed.

    - Refactor NSScreen lookups for point/rect and fix getting the screen for Cocoa_SetWindowPosition() to get the screen for the new position and
      not the window's current screen (which may not exist if the window is off-screen).

    - Fix re-associating the popup and parent window when the child window is shown. Hiding a child window removes it from the window hierarchy
      and so must be added when the window is shown again.

    - Allow popup windows that are not tooltips to gain key focus.

commit ecccf6f
Author: Ryan C. Gordon <icculus@icculus.org>
Date:   Mon May 29 14:46:58 2023 -0400

    windows: Don't allow non-resizable windows to be maximized.

    Fixes libsdl-org#6346.

    (cherry picked from commit d275851)

commit 52b73d4
Author: David Gow <david@ingeniumdigital.com>
Date:   Mon May 29 15:36:59 2023 +0800

    pipewire: Set 'application.id' if SDL_HINT_APP_ID set

    If SDL_HINT_APP_ID is set, pass it as the application.id to pipewire.
    This gives any pipewire-based tools a hint to find an associated
    .desktop file for icons, etc.

commit f74549e
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sun May 28 19:23:56 2023 -0700

    Fixed build warning

    (cherry picked from commit 5007b96)

commit 1da5b2e
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Sun May 28 18:41:21 2023 -0700

    Disable SDL_JOYSTICK_RAWINPUT_XINPUT

    Apparently when using the Xbox One Wireless Adapter, using XInput at the same time as raw input will cause the controller to turn off immediately after connecting. This appears to be a bug in the Windows 11 driver stack, but since WGI provides all the extended functionality we need, this can be turned off for now.

    Fixes libsdl-org#3468

    (cherry picked from commit b2e88ec)

commit 95f2445
Author: Ryan C. Gordon <icculus@icculus.org>
Date:   Thu May 18 13:26:55 2023 -0400

    power: On Linux, compare status strings as case-insensitive.

    In case something reports "Device" when we expected "device", etc.

    Reference Issue libsdl-org#6835.

    (cherry picked from commit df9d0fb)

commit 2f75596
Author: Frank Praznik <frank.praznik@gmail.com>
Date:   Thu May 25 20:37:49 2023 -0400

    Consolidate the X11 WM_CLASS and Wayland app ID envvars

    Consolidate the X11_WMCLASS and WAYLAND_WMCLASS envvars into one SDL_HINT_APP_ID hint. This hint serves the same purpose on both windowing systems to allow desktop compositors to identify and group windows together, as well as associate applications with their desktop settings and icons.

    The common code for retrieving the value is now consolidated under core/unix/SDL_appid.c as it's common to *nix platforms, and the value is now retrieved at window creation time instead of being cached by the video driver at startup so that changes to the hint after video initialization and before window creation will be seen, as well as to accommodate cases where applications want to use different values for different windows.
1bsyl added a commit to 1bsyl/SDL that referenced this issue Jun 22, 2023
commit c2350b23720e4e33aab926b37fd3229ec8e3d846
Author: Sylvain <sylvain.becker@gmail.com>
Date:   Thu Jun 22 18:22:54 2023 +0200

    Revert "Squashed commit of the following:"

    This reverts commit 1e8eef0ec49d65c0edf89e444fc16d9a0f6dbbf3.

commit 1e8eef0ec49d65c0edf89e444fc16d9a0f6dbbf3
Author: Sylvain <sylvain.becker@gmail.com>
Date:   Thu Jun 22 15:19:30 2023 +0200

    Squashed commit of the following:

    commit 433911307237afaec03e2dcb976f4dd1efb62782
    Author: Sylvain <sylvain.becker@gmail.com>
    Date:   Thu Jun 22 10:48:12 2023 +0200

        SDL_DBus_AppendDictWithKeyValue: allows several key/value for other PRs

    commit 8aee6908bbae5d57bc88d35b81c2d57a727dee95
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed Jun 21 18:42:25 2023 -0700

        Make sure we send update complete events for delayed guide buttons

    commit 4c9fb3e16902607d978a2c2f9ade777ad232b628
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed Jun 21 13:59:53 2023 -0700

        Added the events SDL_EVENT_JOYSTICK_UPDATE_COMPLETE and SDL_EVENT_GAMEPAD_UPDATE_COMPLETE

        This allows the application to tell when a joystick polling cycle is complete and can process state changes as a single atomic update. It is disabled by default, at least for now.

    commit 808d83dd67ca3cbedb76c846172f76735203db87
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed Jun 21 13:49:09 2023 -0700

        Allow specifying APP_PLATFORM and APP_ABI on the command line

    commit 214d5daa3c741d7672e53dd741a78b3dc61c4848
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed Jun 21 12:14:50 2023 -0700

        Removed 100 ms hitch when querying third party Nintendo Switch controllers that don't respond to request for info

        Also take advantage of the fact that we know whether the device is connected over Bluetooth now.

    commit 3694dabe7c16bb8e76f6f4820a1987ce16c4a3c9
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed Jun 21 10:28:45 2023 -0700

        Use default sensor calibration if we can't read it from the Nintendo Switch controller

        Fixes https://github.com/libsdl-org/SDL/issues/7830

    commit 6306ee9f421fac43891b22a417d7c5d5eb4e8b31
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 20 09:33:59 2023 -0700

        List the available haptic devices in testhaptic

    commit 8cf5dc9963211c077b3e274886753e12ebfd5107
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 20 09:18:19 2023 -0700

        Build on Android targeting the arm64-v8a architecture by default

        This speeds up iteration time and covers most customer devices

    commit 5f3213eb0e51c9c46e6c3b76d003e59046095c67
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 20 08:40:30 2023 -0700

        Added support for gamepad sensor fusion with the Razer Kishi

    commit 91198baed40d5709020c3001e9234f4580df696a
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Tue Jun 20 13:22:55 2023 +0100

        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.

        Mitigates: https://github.com/ValveSoftware/steam-for-linux/issues/9605
        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 3ddbeab88fcf5bc1b09fb664403b1240d342a6ae
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 20 01:17:44 2023 -0700

        Moved Android sensor event handling to a separate thread

        This makes it so you can interact with sensors on multiple threads, as long as only one thread initializes and cleans up the sensor subsystem.

        This also has the benefit that sensor data is available as soon as possible.

    commit 329e1b8b6aba88fe7271a112fc90cf2bdc10f4ca
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Mon Jun 19 19:42:01 2023 -0700

        Update the sensors before the joysticks so the gamepad code gets fresh sensor readings

    commit 1a9c04e9f1a276f85e08dcb0c0dc0908dc0cfb1a
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Mon Jun 19 19:41:20 2023 -0700

        Don't try to update the gamepad fusion sensors manually, instead rely on the normal update flow

    commit 20ea35138f2f11dc8a0f35e949e372ae8b916534
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Mon Jun 19 16:17:34 2023 -0700

        Use a separate sensor watching function for gamepad events to avoid reliance on system sensor events and prevent a potential deadlock

    commit 70e43c150ec377d5aad2ca238752b1140abc03f0
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Mon Jun 19 08:36:30 2023 -0700

        Added support for blitting SDL_PIXELFORMAT_INDEX1LSB

        Fixes https://github.com/libsdl-org/SDL/issues/7844

        (cherry picked from commit a3d4fd71c3163b2b827f9e87930dec72c93b2fb2)

    commit c6ee9780df4286f66c38f3fa9732daa9afe0a8a3
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sun Jun 18 12:19:54 2023 -0700

        Fixed DualSense controllers not being picked up by the HIDAPI driver

        The hidraw device may take additional time to get the correct permissions for us to open it. In my tests on Steam Deck hardware, this ranges between 5-8ms.

    commit 4e81b4e8dee50bbe7a510ca3f11069e2c6fc4c90
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sun Jun 18 12:19:43 2023 -0700

        Added SDL_HINT_VIDEO_X11_SCALING_FACTOR to allow overriding the content scale on X11 (thanks Andres!)

    commit 210c135f744b757872eb0811988b53dca8e46462
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sun Jun 18 12:19:38 2023 -0700

        Implement SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED for X11

        To match the focus stealing prevention logic from windows/osx.

        I didn't implement SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN as there is no
        standard mechanism for us to do so. In most cases marking a window as OverrideRedirect
        will cause to not acquire focus when mapped. And in steam we are doing that when
        appropriate.

        I still left a note in X11_ShowWindow() regarding this behaviour.

    commit 9351bf6dd10734c7dc43442537341bdb19801999
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sun Jun 18 12:19:22 2023 -0700

        Add handling for SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED and SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN on macOS

        - Cocoa_ShowWindow will order a window that is not being activated below the key window (if one exists) then set visible

        - Cocoa_RaiseWindow calls -[NSWindow orderFront:] without changing the key window

    commit f168f9c81326ad374aade49d1dc46f245b20d07a
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 17 12:42:55 2023 -0700

        Added support for the GameSir G4 Pro

        We can't read device info or IMU calibration from this controller, and it has no gyro or accelerometer, but is otherwise perfectly functional.

    commit b77064441149413543f190ee5067760e6acc1358
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 17 09:46:46 2023 -0700

        Fixed building on older kernel headers

    commit b98494a10154d4e6944279125a2194cac20d7c85
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 17 09:39:50 2023 -0700

        Fixed building on older kernel headers

    commit 9fe384b69636cf672cee09b185cae4762b5aecfe
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 17 09:28:27 2023 -0700

        Fixed display orientation function names for SDL 3.0 convention

    commit d91e96e7f50b9c3cb0e1dacda39274b4af037a96
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 17 08:59:52 2023 -0700

        Use SDL_HINT_GAMECONTROLLER_SENSOR_FUSION as a list of controllers to enable sensor fusion

        There are too many wraparound style controllers out there to enumerate them all, so instead make this a user option in applications that support it.

    commit 610c31c7b7957e6f670cc94698f04861ff839d3f
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 17 08:28:37 2023 -0700

        Generalized the sensor coordinate transform for wraparound gamepads

    commit 9eb5eab0adb032336ebaf5d980d5a246977e8272
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 17 08:04:34 2023 -0700

        Use the correct orientation transformation based on whether the device is naturally landscape or portrait

    commit e6d1ba2a17a7e157d5aa36957f16842ac17cba89
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 17 00:52:40 2023 -0700

        Added the concept of display natural orientation

        Also renamed SDL_GetDisplayOrientation() SDL_GetDisplayCurrentOrientation()

        The natural orientation of the primary display is the frame of reference for accelerometer and gyro sensor readings.

    commit 8de6ce7e92907c5f509c6b33c5ee2a5f7b3c1c0c
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 16 17:48:34 2023 -0700

        Rotate the sensor axes to match gamepad orientation when using the device sensors for game controllers

    commit a9c86e518aa1b90fd5e8f1a6f3b1d23ce76d845b
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 16 17:48:18 2023 -0700

        Added the Razer Edge controller to the list of wraparound controllers

    commit c207cd3f568d17679a6a728a8a157811326c7fdd
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 16 16:03:55 2023 -0700

        Added the Razer Junglecat to the wraparound controller list

    commit e4f53e6b214cf476c9ad4b035ead97fb62da81c0
    Author: Ozkan Sezer <sezeroz@gmail.com>
    Date:   Sat Jun 17 01:01:10 2023 +0300

        testevdev.c:  comment out two unused data to fix build.

    commit 42e4639a5eab214370b1d6939ba09f65d553c9f7
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed Jun 14 22:03:44 2023 -0700

        For gamepads that don't have their own sensors, try to use the system sensors.

        This allows using the gyro and accelerometer in handheld devices in conjunction with built-in or wraparound controllers.

    commit d5845928222f24be91fc27f68e846c1b8bcd9a93
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Fri Jun 16 15:16:44 2023 +0100

        linux: If the kernel specifically tells us the device type, trust it

        If a device is positively identified as an accelerometer, pointing stick
        or clickpad, then we don't need to second-guess it.

        In practice this does not change the result for any device in our
        test data, so add some artificial records that exercise this.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 0d5aa70e62e477e99d024287070c70e3ee7b9da1
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Fri Jun 16 15:14:33 2023 +0100

        linux: Pass evdev properties when guessing device type

        In newer kernels, devices that can be positively identified as a
        particular device type (for example accelerometers) get a property
        bit set. Plumb this information through into the function, but don't
        use it for anything just yet.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit a4ce721d7a3c9b6062d172192edb82b71836f0a2
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Fri Jun 16 15:15:31 2023 +0100

        testevdev: Allow device properties to be fully populated

        The props array was too small for the highest property bits to be set,
        although in practice this didn't matter since only the lower-order bits
        have a meaning. Make it consistent with all the others.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit fa0ca3d41e5638949bf4d6fa44ee713fd1f62d38
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Fri Jun 16 14:53:29 2023 +0100

        linux: Distinguish between "device with keys" and a full keyboard

        udev distinguishes between ID_INPUT_KEY, a device with any keyboard keys
        at all (including for example USB numeric keypads, Bluetooth headsets
        with volume control buttons, and some game controllers; and
        ID_INPUT_KEYBOARD, a reasonably fully-featured keyboard that you could
        use for general-purpose text entry. If we do the same here, then it's
        useful input to our heuristics for identifying devices: for example,
        a device with ID_INPUT_KEY could reasonably be a gamepad, but a device
        with ID_INPUT_KEYBOARD certainly isn't.

        Resolves: https://github.com/libsdl-org/SDL/issues/7827
        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 9b7a9ca6669326e61be3e98e0fbceb93d03ca48e
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Fri Jun 16 14:29:53 2023 +0100

        testevdev: Add some more laptop built-in devices

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 00b6db68defb31fc3f2a0f1de6edad9e418fcad2
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Fri Jun 16 14:29:41 2023 +0100

        testevdev: Add some EVIOCGNAME and USB name strings to test data

        We don't currently use these for anything, but we might start using
        them as input to our heuristics as part of #7697.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 3772d6cc9926f294f04d6a25be9a2c0f7a43b66a
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 15 19:46:35 2023 +0100

        testevdev: Add raw HID report descriptors where available

        We don't currently use these in our device-classification heuristic,
        but it could be a useful input in future.

        Thanks to Sam Lantinga, Ben Fradella, kevenwyld and schlegp for
        providing some of these.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 2b7556fea27e517338135e6cfa934222409d88ca
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Fri Jun 16 14:35:16 2023 +0100

        testevdev: Correct typo in bus type for Xbox Series S|X via Bluetooth

        All Bluetooth devices are bus type 0x0005.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit c13e511844c870d8bae8816ca6c07c7cd8c12a0e
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Tue Jun 13 17:48:50 2023 +0100

        testevdev: Try to correct Wii devices guessed from kernel source

        The comments here disagreed with the actual bytes. According to
        https://elixir.bootlin.com/linux/v6.3.7/source/drivers/hid/hid-wiimote-modules.c,
        the Balance Board reports BTN_A and ABS_HAT0X, HAT0Y, HAT1X and HAT1Y.
        This means the comments here were correct, but the .abs bits shown
        were in the wrong byte.

        Matching the Wii U Pro Controller against the same kernel source, it
        appears to be correct: it's the same representation as a PS3 gamepad,
        except that it lacks the Z and RZ axes for analogue triggers.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit ffdafcd880fd2c7680b2b2b87d5c7a6e4654ff17
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Tue Jun 13 17:26:51 2023 +0100

        testevdev: Verify most Wii devices against real hardware

        Some of the test data previously seen here was guessed from kernel
        source code, and not all of it was correct. The following devices have
        now been verified against `evemu-describe` output with Linux 6.3
        (thanks to Jeremy Whiting for collecting this):

        - basic Wiimote
            - buttons
            - 3-axis accelerometer
            - infra-red sensor for Sensor Bar location (precise aim)
        - Motion Plus accessory (3-axis gyroscope)
        - Nunchuck accessory (joystick, 2 buttons, second 3-axis accelerometer)
        - Classic Controller accessory (a complete traditional gamepad)

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 739f78302ba96afe88b84592a909c6b6a37644c6
    Author: SDL Wiki Bot <icculus-sdlwikibot@icculus.org>
    Date:   Fri Jun 16 12:22:18 2023 +0000

        Sync SDL3 wiki -> header

    commit 26df6899356afcbea628e85be79d3063ccdc4c71
    Author: Anonymous Maarten <anonymous.maarten@gmail.com>
    Date:   Fri Jun 16 14:21:33 2023 +0200

        docs: expand CMake documentation + add minimal CMake project for reporting issues

    commit 378e33bb2cae7e475f1cda8c75f71f6232455833
    Author: Sylvain <sylvain.becker@gmail.com>
    Date:   Fri Jun 16 10:05:58 2023 +0200

        Android: potential ANR during onKeyDown/Up
        SDLActivity may call onNativeKeyDown, while application is quitting

    commit e72935a445448104d02d4ecca2d24fe06141b15b
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Thu Jun 15 16:43:35 2023 -0700

        Check for modff in addition to modf

    commit dab4f296b8adde71f982dde703c79a3d9be5be65
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Thu Jun 15 16:43:22 2023 -0700

        Cleanup spacing

    commit 16b57d2ff109e095e0c4024070075ddd1d5f410b
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 15 19:25:23 2023 +0100

        testevdev: Add details of another driving simulator controller

        Thanks to Ben Fradella.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 2b007512065af0f64b1bfed291e26e771f70728d
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 15 15:50:03 2023 +0100

        testevdev: Expand test data for X-Box One Elite 2

        This slightly newer device than the one from #7814 is functionally
        equivalent when connected via USB. When connected via Bluetooth, it has
        a different button mapping.

        Thanks to Sam Lantinga.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 62ed6f453f6226784c1a47baf6bc544aed15fa7f
    Author: Mathieu Eyraud <70028899+meyraud705@users.noreply.github.com>
    Date:   Thu Jun 15 09:59:07 2023 +0200

        Use SDL_strdup instead of strdup

    commit 73927b09480fd5d664f7077a70a8b6df318cdd2d
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed Jun 14 15:16:21 2023 -0700

        Removed unused function

    commit 2e465ae31bd3a8ad2a4b239c4d6ff1e8c57efe65
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed Jun 14 11:05:10 2023 -0700

        Revert "Added SDL_nextafter() and SDL_nextafterf()"

        This reverts commit bc5d074818bfb08b7429d5e6d8ef69215acb408e.

        It's not clear that we need these yet, so I'm going to remove them for now.

    commit 0c16f4faf00eb573d051cac7d60ed8dd22e5596a
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed Jun 14 10:15:06 2023 -0700

        Fixed third-party Nintendo Switch Pro controllers shutting down when we try to set the home LED.

        This fixes the PDP Afterglow Wireless Deluxe Controller.

    commit 23e007d3b7c8f8f5ccd99e58cd52bb5636fc8d04
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed Jun 14 00:02:32 2023 -0700

        Fixed third party Nintendo Switch Pro Controller resetting when being sent an unsupported command to set the Home LED

        Tested with the PowerA Fusion Pro Wireless Controller in Bluetooth mode

    commit 8c95bd814bf1cf0ea1f12aa724938176a7dfd780
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 13 22:40:51 2023 -0700

        Allow switching licensed Nintendo Switch Pro controllers into gyro input mode

    commit cdfc0c5a3314e4e0cd5152feddd8950c7eb797f1
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 13 22:20:58 2023 -0700

        Added support for the PowerA Fusion Pro Wireless Controller in Bluetooth mode

        This controller shows up with a VID/PID of 0, but has full functionality over Bluetooth

    commit 0f4b15e16b7f07a46db6dc8e651f8c1849d658c5
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 13 16:53:10 2023 -0700

        Removed more Linux Xbox mappings in favor of the automatic mapping

        This fixes the Xbox Series X share button on Linux 5.x kernels.

    commit 883b0f4071687f2e5c8329963f97504e9679394b
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 13 16:49:33 2023 -0700

        Cleanup for previous change, fixing typos, etc.

    commit 9567989eb3ce9c858f0fe76806c5ccad69da89ba
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 13 16:41:52 2023 -0700

        Use the automatic mapping instead of a hardcoded one for Xbox controllers on Linux

        This is much more robust and able to dynamically create a mapping for Xbox One S, Xbox Series X, and Xbox Elite 2 controllers.

    commit db1d4d3d76f5e21b2547463710b513fe0ebd7fad
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 13 16:40:30 2023 -0700

        Added automatic mapping support for Xbox controllers on the 6.x Linux kernels

        This automatically adds support for the share button and paddles when present.

    commit 0f24956b0af20c8dc3bde9bc1c921f2d127297be
    Author: Sylvain <sylvain.becker@gmail.com>
    Date:   Tue Jun 13 23:10:29 2023 +0200

        testautomation_hints.c: free hint memory

    commit 2c3717881f3500ae73ece85bffb70dd868535dbf
    Author: Sylvain <sylvain.becker@gmail.com>
    Date:   Tue Jun 13 23:00:00 2023 +0200

        testautomation_events.c: initialize "timestamp" to solve "conditional jump or move depends on uninitialised value"

    commit 56ba7f2ff073b50f82d28f98667c2d14845750fd
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Tue Jun 13 16:53:56 2023 +0100

        testevdev: Add details of X-Box One Elite 2 via USB

        Thanks to iacore for capturing these.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 74484511eb55c88e91fdd256828d11598a699550
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Tue Jun 13 16:47:56 2023 +0100

        testevdev: Provide a pointer to more information about adding test-cases

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit bc5d074818bfb08b7429d5e6d8ef69215acb408e
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 13 07:34:50 2023 -0700

        Added SDL_nextafter() and SDL_nextafterf()

    commit b0677f476fa43f4a113b04a959228fd38f95d740
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 13 10:06:36 2023 -0700

        Added automatic mapping for Xbox Elite paddles using the xpadneo driver

        We can't actually tell yet whether a controller has paddles, so this code isn't effective, but I'll file an upstream issue and see if we can get that resolved.

    commit 071d1e29dd4f80605932f320aa2e05fda383944c
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 13 10:05:19 2023 -0700

        Fixed joystick vendor detection in Linux automatic gamepad mapping

    commit 5a62a4596e33d4a4488543c7ca5aaadd4df36760
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 3 23:55:56 2023 -0700

        Fixed building with the 16.1.4479499 Android toolchain

        (cherry picked from commit b9d1c483b90e2a1c23053692e06d15f9dbd5fe99)

    commit cf1dc66e2cfc7a65374c5fea681dd31c50363a2c
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Fri Jun 9 13:24:21 2023 +0100

        linux: Improve gamepad mapping heuristic to accept Android conventions

        This heuristic for gamepads without a more specific mapping already
        tried two incompatible conventions for handling triggers: the Linux
        Gamepad Specification uses hat switch 2 for the triggers (for whatever
        reason), but the de facto standard set by the drivers for older Xbox
        and Playstation controllers represents each trigger as the Z-axis of
        the nearest analog stick.

        Android documentation encourages Bluetooth gamepad manufacturers to use
        a third incompatible convention where the left and right triggers are
        represented as the brake and gas pedals of a driving simulator
        controller. The Android convention also changes the representation of
        the right stick: instead of using X and Y rotation as a second pair
        of axes, Android uses Z position as a second horizontal axis, and
        Z rotation as a second vertical axis.

        Try to cope gracefully with all of these. This will hopefully resolve
        the issue described in #5406 (when using unpatched kernels).

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit c4d49fadd4500cb522b2a98e5a42d024c566d8bf
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Fri Jun 9 13:06:30 2023 +0100

        linux: Reduce magic numbers when mapping gamepad axes

        The bitfield `mapped` has two different sets of meanings, depending
        whether we're setting up the triggers or the d-pad. Represent them
        as symbolic constants rather than opaque integers.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit dec0dbff13d4091035209016eb2d0dd82c9aba58
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Mon Jun 12 16:57:41 2023 -0700

        Fixed enumerating Steam Controllers on iOS

    commit d95dbe78bb7a5087ecfb8d301417b1108d868738
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Mon Jun 12 15:39:57 2023 -0700

        Fixed n3ds build

    commit cdc40ee0546f6a761c369076a9e7a11fa0ea35b4
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Mon Jun 12 15:26:34 2023 -0700

        Reduce the chance of destroying the joystick mutex while it's in use

        Fixes https://github.com/libsdl-org/SDL/issues/7811

    commit 6ab846b6885a147013527d187c21eb8f686ca615
    Author: Linus Probert <linus.probert@gmail.com>
    Date:   Mon Jun 12 18:27:40 2023 +0200

        clipboard: Fixes additional x11 clipboard bugs found in tests

    commit a2ba5e90524a7e4f5bcbfc2bf53c737fecc09b26
    Author: Linus Probert <linus.probert@gmail.com>
    Date:   Mon Jun 12 13:06:16 2023 +0200

        clipboard: Fixes testautomation fails introduced by clipboard changes

    commit 4e0f94ea7d58d4a1aac624421d73110232df3efd
    Author: Sylvain <sylvain.becker@gmail.com>
    Date:   Mon Jun 12 11:45:46 2023 +0200

        Android: add timeout when waiting the SDL thread to finish

        C SDLmain() thread might have started (mSDLThread.start() called)
        while the SDL_Init() might not have been called yet,
        and so the previous QUIT event will be discarded by SDL_Init() and app is running, not exiting.

        This is reprocible by adding instrumentation code in the SDLActivity.

        And hopefully, this could fix an ANR, where SDLActivity is in WAITING state (in thread.join()):
          at java.lang.Thread.join (Thread.java:1519)
          at org.libsdl.app.SDLActivity.onDestroy (SDLActivity.java)

        while SDLThread seems to be running

    commit 125e7420ecd2b0d1847aef804f53e614fbc68253
    Author: Ryan C. Gordon <icculus@icculus.org>
    Date:   Sun Jun 11 12:43:47 2023 -0400

        cocoa: Warp mouse to center of window before enabling relative mouse.

        This prevents the case where the mouse might be at the edge of the
        window when enabling relative mode, which confuses macOS, at it
        might believe the user is attempting to resize the window.

        Fixes #6994.

        (cherry picked from commit 2afb49ba9a2edc361a3b35d8e30be977a5bcc0c4)

    commit 4cfacd5cb7ab79cc09d718871810973a80f0c86c
    Author: Ozkan Sezer <sezeroz@gmail.com>
    Date:   Sat Jun 10 20:50:02 2023 +0300

        SDL_dynapi.c: minor cosmetics.

    commit 0103ec112610b67d2f8f603140e4b2c4e98e4d99
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 10 08:43:43 2023 -0700

        Fixed accidental commit

    commit 7f864151464441fde7be300aaecab80887a99fa8
    Author: SDL Wiki Bot <icculus-sdlwikibot@icculus.org>
    Date:   Sat Jun 10 15:42:15 2023 +0000

        Sync SDL3 wiki -> header

    commit 281018f169b8b7edbcaa48dab25627b359b9294a
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 10 08:39:20 2023 -0700

        Make it clear that you can't mix 2D rendering and the window surface API

        Also added functions to query and destroy the window surface so you can switch between modes if you want.

        See https://github.com/pygame-community/pygame-ce/issues/2190 for more details.

    commit 5490873daa12a57ff4b36090f25f04530323c6e4
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 9 18:41:21 2023 -0700

        Fixed querying device info on the MOBAPAD M073

        The query packet needs to contain valid rumble data in order to be accepted by the controller.

        Fixes https://github.com/libsdl-org/SDL/issues/7788

    commit 2042e9c4e3cba6ffa9c34abac14828e31365f98b
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 9 17:34:12 2023 -0700

        Only update the serial number if it hasn't already been set

        This fixes the serial number for Nintendo Switch Pro, which is queried from the hardware in device initialization, and was later clobbered by the USB string which isn't correct.

    commit c8051b11e84abdda49d5755c911457b5105d8d93
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 9 14:34:59 2023 -0700

        Fixed reading input from the Razer Atrox Arcade Stick using Windows Gaming Input

    commit aaccf3cd52882d3ac227541976cd90b75a2f15b5
    Author: Sylvain <sylvain.becker@gmail.com>
    Date:   Fri Jun 9 14:21:17 2023 +0200

        X11: common function to wait for the WM before sending SDL Window events

    commit 8096f7269b0b0692bdb08cf0f41e411ae9203619
    Author: Sylvain <sylvain.becker@gmail.com>
    Date:   Fri Jun 9 09:41:54 2023 +0200

        Android: add robustness. check that the native code is run for the first time.

    commit ae9d8acc3b405be05f1d790489ed261ba7cfc518
    Author: Sylvain <sylvain.becker@gmail.com>
    Date:   Fri Jun 9 09:27:39 2023 +0200

        Android: when an EventFilter is binded to SDL_EVENT_DID_ENTER_FOREGROUND event and triggered, GL context is expected to be already restored.

    commit 4c0758a234658a0f48a56d2263c744aaa9cee898
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Thu Jun 8 12:39:32 2023 -0700

        Fixed crash if display couldn't be found in SDL_UpdateFullscreenMode()

    commit d9c17e70552fb9a085de5bac0bc7675b4ea593e0
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 8 18:24:09 2023 +0100

        testevdev: Add details of some more 8BitDo devices

        Thanks to Jeremy Whiting.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit a2ed083285e2997ed14b4607b31954d99d7245b2
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 8 17:30:30 2023 +0100

        testevdev: Describe several equivalent devices

        https://github.com/ValveSoftware/steam-devices/pull/34 lists several
        more devices that are functionally equivalent to this one from the
        point of view of their evdev metadata. Thanks to apgrc.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit f4a53e78c8f027efe6db2d5edd84630f21c8c22e
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 8 15:13:38 2023 +0100

        testevdev: Add test data for a DualSense (PS5) gamepad

        Also make details of PS4 gamepads (which are very similar from an evdev
        point of view) more specific.

        Thanks to Sam Lantinga and Jeremy Whiting for recording these.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 2fb1df155138accdf77700ee7f5a76d4bd0895ac
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 8 16:00:27 2023 +0100

        testevdev: Add test data for Nintendo Switch Joy-Cons via Bluetooth

        Thanks to Jeremy Whiting.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 8a82e06075628525e6dbffbcb6a277e864d183e1
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 8 15:51:10 2023 +0100

        testevdev: Add test data for Microsoft Xbox Series S|X Controller

        Like the Stadia controller, this is unusual because it represents the
        Share button as the Record key from a multimedia keyboard (as of Linux
        6.2.11 with the xpad driver). Thanks to Jeremy Whiting.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit ff01b43459b8cd9cd24ce6f2a91d86e03f0f7bc9
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 8 15:48:46 2023 +0100

        testevdev: Add Google Stadia controller

        This is a bit unusual because it has a small number of what would
        ordinarily be keyboard keys. Thanks to Jeremy Whiting for recording
        this.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 9ad0b8b47f351fb30c6cc35bd47b1f09872836d4
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 8 15:47:50 2023 +0100

        testevdev: Add test data for another Switch Pro Controller

        A newer evemu-describe transcript has this same controller with its
        buttons mapped differently, presumably a result of driver changes in
        the Linux kernel. Either way, we should recognise it as a gamepad.
        Thanks to Jeremy Whiting.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 7b526d0cad2b1238427f44c40f3279e7196a602f
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 8 15:46:52 2023 +0100

        testevdev: Finish incomplete data for Switch Pro Controller via USB

        This didn't include any buttons, which I assume was because I
        transcribed them incorrectly rather than reflecting reality. Confirmed
        against another Switch Pro Controller on a more recent kernel (thanks
        to Jeremy Whiting).

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 4c33ef94c6d64836321fa24269c45a2dff4106d4
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 8 15:45:17 2023 +0100

        testevdev: Note a functionally-equivalent device

        We don't need to re-test the heuristic with the same input data, but
        knowing that another device has equivalent evdev metadata is useful
        information to record. Thanks to Jeremy Whiting.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 4c035dc1e38d1a47718bfea8e6921289da68296a
    Author: Simon McVittie <smcv@collabora.com>
    Date:   Thu Jun 8 15:14:19 2023 +0100

        testevdev: Add another laptop touchpad

        This was reported by Rémi Bernon as an example of older SDL's non-udev
        code path going wrong for touchpads when the invoking user happens to
        be in the input group, which I believe was fixed by fdd945f2.

        Signed-off-by: Simon McVittie <smcv@collabora.com>

    commit 32d015a6a0c2a4fcfc8aad74fa60a3b8c5f6f53b
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Thu Jun 8 10:46:56 2023 -0700

        Fixed PS3 controller initialization over Bluetooth

        Now that we have hidapi that knows whether the controller is connected via Bluetooth or USB, this is much easier to fix.

    commit e15da1985a23bdc6e93701e728c327ba664dc1b8
    Author: Frank Praznik <frank.praznik@gmail.com>
    Date:   Wed Jun 7 15:04:49 2023 -0400

        video: Apply cleared flag states when restoring hidden windows

        Hiding a window and then clearing the minimized, maximized, fullscreen, or grabbed flags wouldn't result in the new state being applied to the window when shown, as the pending flags would always be zero, resulting in the flag application function never being entered. Calling SDL_RestoreWindow() didn't result in the minimized or maximized state being cleared on the hidden window either.

        Save the current window flags to the pending flags when hiding a window, and universally apply the pending flags when the window is shown again to ensure that all state that was set or cleared when the window was hidden is applied. Any pending flags that match the existing window flags will be automatically deduplicated by the corresponding functions.

    commit 49b5cfa6c5cb9bb8cecce508e12fa7f8e0cc302f
    Author: Ryan C. Gordon <icculus@icculus.org>
    Date:   Wed Jun 7 15:42:22 2023 -0400

        x11: check if window size/position has changed during SDL_ShowWindow.

        Fixes #4216.

    commit dc06116c718692d94145656926445da76acd24fe
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue Jun 6 12:33:48 2023 -0700

        Steam sets the device version of the Steam Virtual Gamepad to 0, for the best compatibility with old games

    commit d032492aaba19c108dfd5e52866573bd02bf6148
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Mon Jun 5 21:28:12 2023 -0700

        Fixed detecting Bluetooth Steam Controllers on Windows

    commit 17c397f7ece85e1948a2eca739dd99122f761ea2
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Mon Jun 5 21:18:49 2023 -0700

        Save the error code before doing any other operation

        SDL_ClearError() resets the Win32 error code to 0

    commit 6e7769cde1e29b65f2e89688fe0d990e755a7017
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Mon Jun 5 18:02:37 2023 -0700

        Fixed detecting Bluetooth Steam Controllers

    commit 6150b5b3cbde0e592c4ffe822f66aa5f9c90c3d9
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sun Jun 4 05:37:06 2023 -0700

        Don't bother re-encoding Latin1 characters in the ASCII range

    commit 491ae20d963cff397b5980b31d142d576e74becb
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sun Jun 4 02:06:52 2023 -0700

        Only convert the result of XLookupString() if it's not already UTF-8

        Fixes https://github.com/libsdl-org/SDL/issues/7766

    commit c369b900199f905c51edb372bd7780f67a544a8c
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sun Jun 4 01:01:06 2023 -0700

        Fixed SDL_iconv_string() truncation when handling SDL_ICONV_E2BIG

    commit d40695115f8fa5d7c81ac5bc5e8b0188d040b3b5
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 3 23:24:21 2023 -0700

        Cleaned up Alt-Enter/Ctrl-Enter fullscreen toggle logic

        Alt-Enter will go from the current state to fullscreen desktop, or if already there, will leave fullscreen mode.
        Ctrl-Enter will go from the current state to exclusive fullscreen mode, or if already there, will leave fullscreen mode.

    commit 052a9d3284396e1db8fb26642067c344ef6e1467
    Author: Rusty Moyher <rustym@gmail.com>
    Date:   Fri Jun 2 11:45:21 2023 -0500

        macOS: Removed the fullscreen blanking window

        - Removed the blanking window used in SDL_WINDOW_FULLSCREEN. This allows CMD + Tab to work.
        - Changed the fullscreen NSWindow level so this works properly.

        Fixes issue #7776

    commit fa41ece65f50cbfe5043a5d49911e37e60ebad5e
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 3 11:53:36 2023 -0700

        Allow other applications to open controllers on macOS

    commit 6815e75cafee8e7caaacf1f428b6539c8bbc7f7d
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 3 11:39:03 2023 -0700

        Steam uses a different VID/PID for the Steam Virtual Gamepad on Windows

    commit 5f00147e61017b0cdae73d9c5752e0cf136b06bc
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sat Jun 3 11:35:27 2023 -0700

        Revert "Fixed detection of the Steam Virtual Gamepad on macOS"

        This reverts commit 5fcd70578bdde3eaaa51aa4ab6c24ed08bd49db3.

        Steam has been updated to send a version of 1 to avoid conflicts with controllers that report a version of 0.

    commit 0c862d9a554bb7e3fb6092dd07f6e928bf814736
    Author: Ozkan Sezer <sezeroz@gmail.com>
    Date:   Sat Jun 3 17:23:40 2023 +0300

        added compiler support comment about #pragma push_macro/pop_macro.

    commit 5fcd70578bdde3eaaa51aa4ab6c24ed08bd49db3
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 2 18:37:45 2023 -0700

        Fixed detection of the Steam Virtual Gamepad on macOS

    commit 9837653b9d20d48b30caa66f93951b8604e7e9ea
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 2 15:52:56 2023 -0700

        Allow the application to send commands to Nintendo Switch controllers

    commit 7c55845c804e2272df8bc111dea5d3e9d11670a0
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 2 11:20:31 2023 -0700

        Fixed build if SDL_JOYSTICK_RAWINPUT_MATCHING isn't enabled

    commit 767507fcf6f4607edb413acb53a6c029863701ed
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 2 11:16:07 2023 -0700

        Don't use raw input while Remote Desktop is active

        Raw input will not send game controller events while Remote Desktop is active, so dynamically switch between XInput and raw input when Remote Desktop state changes.

        Fixes https://github.com/libsdl-org/SDL/issues/7759

    commit a5a1844681d87950db50a39bc2b359d45bc7b08d
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 2 10:20:29 2023 -0700

        Fixed build error

    commit e8b5b4881c8eb31bb7de5adef3479305a73fb0bf
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 2 09:38:18 2023 -0700

        Fixed WGI immediately being correlated with raw input devices with no input

        The at rest match state is 0x0000008800000000, not 0

    commit 2e27812d39d17831da0a0d8afa1add6c8795af5a
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Fri Jun 2 08:51:47 2023 -0700

        Fixed event sequence when Remote Desktop connects and disconnects

        1. Send display disconnected events for all displays no longer connected
        2. Send display connected events for all displays that have been connected
        3. Send window display events for any windows that have changed displays

    commit 6aaf03232060a9a89faed1004c9afb0b31899d6a
    Author: Alibek Omarov <a1ba.omarov@gmail.com>
    Date:   Fri Jun 2 05:55:42 2023 +0300

        wayland: reset orientation bitmask before reading values from hint on QtWayland

        Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
        (cherry picked from commit 68e3e99087544c64abb534613643080312aced96)

    commit 56520372cad6915bc954dc33a4be67b07556307d
    Author: Alibek Omarov <a1ba.omarov@gmail.com>
    Date:   Fri Jun 2 05:59:06 2023 +0300

        hints: clarify support for comma-separated values for QtWayland orientation that's available since 2.0.22

        Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
        (cherry picked from commit c39524042520d6962434228ab8af9ba7e0542308)

    commit 8c476ca1b0aafd090028d7ec32f417cb4bf05c62
    Author: Ozkan Sezer <sezeroz@gmail.com>
    Date:   Fri Jun 2 14:56:40 2023 +0300

        hidapi/libusb: need libusb >= 1.0.16 because of libusb_get_port_numbers

    commit e27c10a5b1e79d1eac3a679d749a29d35ce7b109
    Author: Ozkan Sezer <sezeroz@gmail.com>
    Date:   Fri Jun 2 14:55:24 2023 +0300

        hidapi/libusb: don't try to dlsym libusb_wrap_sys_device

        not used in SDL.

    commit 3ecdbf27cc2bef2501af8a85287590d3be1200a0
    Author: Ozkan Sezer <sezeroz@gmail.com>
    Date:   Fri Jun 2 14:36:14 2023 +0300

        hidapi: silence redefinition warnings

    commit f082c68b2ff564a7c63edba3551fadfe3b02970a
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Thu Jun 1 10:48:15 2023 -0700

        Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/582

    commit 0ad089de2150977e1d34cf2798e4cf2e97b981be
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Thu Jun 1 08:30:10 2023 -0700

        Backed out local changes to build with libusb on Windows

    commit b36679b90e5df70a2b63b3eacbbd013f2afd0395
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Thu Jun 1 08:27:56 2023 -0700

        Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/582

    commit 20182eed7c14ca172c746d28ac08855894f43249
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Thu Jun 1 07:47:28 2023 -0700

        Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/572

    commit 0cff44dbd46e9ad19cf03856c4819f49d0f5e296
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Thu Jun 1 07:27:51 2023 -0700

        Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/577

    commit 4f58445f0389ca1a2a7d4bb03248007484038df1
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed May 31 14:28:50 2023 -0700

        Ignore both the mouse and keyboard endpoints of Steam Controllers when enumerating game controllers

    commit c886e8067507b3de47b3a7ad6a37aa8cac12e6f1
    Author: Nikita Krapivin <alienoom@yandex.ru>
    Date:   Thu Jun 1 01:09:34 2023 +0500

        gdk: Virtual keyboard and text input backend

    commit b6a88b0339537d842fc59b2095d4eda80934b214
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed May 31 10:49:46 2023 -0700

        Don't try to interpret Xbox controllers as raw HID devices on Windows

        These generate fake reports which don't include separate trigger axes, and the HIDAPI joystick driver doesn't understand this report format.

    commit adad6514d4f42998b8ae16aa0ca1ea8031568743
    Author: Frank Praznik <frank.praznik@gmail.com>
    Date:   Mon May 15 11:37:43 2023 -0400

        wayland: Add aspect-correct output for scaled modes

        Add aspect-correct output of scaled video modes and a hint to control this behavior (aspect, stretch, or none).

        The Wayland spec states that fullscreen surfaces that do not cover the entire output shall be centered with the borders masked by the compositor, so no additional work is required aside from calculating the proper window dimensions.

        The default is still 'stretch' mode, as some window managers as of this time (KDE and older versions of GNOME still found in LTS distros) don't behave according to the spec and present an unmasked window that is not centered, so it's not yet safe to change the default.

    commit 4644ac99fa32bc10b27784c5f9530f2cf0aadab0
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Wed May 31 08:27:27 2023 -0700

        Remove unneeded property type check

    commit cddcc4f406cd77acfa95a95870886bebc29682ad
    Author: Wohlstand <admin@wohlnet.ru>
    Date:   Wed May 31 03:54:38 2023 +0300

        Don't ignore "build-scripts"

    commit 8e0b47331f33ec378a3375d50e230d1ec34b27b2
    Author: Wohlstand <admin@wohlnet.ru>
    Date:   Wed May 31 03:38:25 2023 +0300

        Also ignore "build-*/" sub-directories

        Locally, I do make multiple build directories for various purposes, like "build-debug", "build-release", "build-novideo", etc. Also, Qt Creator (if configure it) may automatically create build directories that always starts with a "build-*" prefix.

    commit e9e4a9175f9acbff039d714feb1929384ba87145
    Author: Ozkan Sezer <sezeroz@gmail.com>
    Date:   Wed May 31 04:50:02 2023 +0300

        testautomation_guid.c: fix integer warning in 32 bit builds.

    commit 0b28cbe385c808b3cbe89b8eb7c2b10d7849599b
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue May 30 16:36:13 2023 -0700

        Allow building on really old Linux kernels (thanks @sezero!)

    commit 9b147eb80b29ee42d68c87041900f988ba068d65
    Author: Ozkan Sezer <sezeroz@gmail.com>
    Date:   Wed May 31 01:55:50 2023 +0300

        SDL_x11window.c: apply missing SDL2-to-SDL3 portage to fix build.

    commit c521e1286be9284d3652569fab02718d9faa4d06
    Author: Ozkan Sezer <sezeroz@gmail.com>
    Date:   Wed May 31 01:55:40 2023 +0300

        SDL_dbus.h: define DBUS_TIMEOUT_USE_DEFAULT if not already defined.

    commit 20dfb7df2c7b658ddacf6a835f9a9c6bd6f9c07a
    Author: Ozkan Sezer <sezeroz@gmail.com>
    Date:   Wed May 31 01:55:40 2023 +0300

        hidapi/linux/hid.c: define BUS_SPI if not already defined.

    commit 19c10b41fd0435e259c1da675733cc446541f9fa
    Author: Ryan C. Gordon <icculus@icculus.org>
    Date:   Tue May 30 17:04:31 2023 -0400

        x11: Attempt to wait for SDL_MaximizeWindow to complete before returning.

        Fixes #7070.

        (cherry picked from commit 379a6f4dabc448d37a5823724d507967e2e069eb)

    commit 1fdcb610ff4d26bc95a7425a628a1c0ec14f7e32
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Tue May 30 05:52:07 2023 -0700

        Fixed build

    commit 4c36726a319f86aaa1c16c865705f4ec54bcfcd8
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Mon May 29 16:44:17 2023 -0700

        macOS child window fixes

        - Fix places working with window coordinates that need to call SDL_RelativeToGlobalForWindow or SDL_GlobalToRelativeForWindow

        - Remove NSScreen param from ConvertNSRect(). Reflecting the Y coordinate is done relative to the main screen height (which ConvertNSRect
          was already doing) so the explicit screen isn't needed.

        - Refactor NSScreen lookups for point/rect and fix getting the screen for Cocoa_SetWindowPosition() to get the screen for the new position and
          not the window's current screen (which may not exist if the window is off-screen).

        - Fix re-associating the popup and parent window when the child window is shown. Hiding a child window removes it from the window hierarchy
          and so must be added when the window is shown again.

        - Allow popup windows that are not tooltips to gain key focus.

    commit ecccf6f9caedb9c8e8d50ec2d6c26b188f8466c1
    Author: Ryan C. Gordon <icculus@icculus.org>
    Date:   Mon May 29 14:46:58 2023 -0400

        windows: Don't allow non-resizable windows to be maximized.

        Fixes #6346.

        (cherry picked from commit d275851dfbd586910ddf1fbed8ef54714afbe6c4)

    commit 52b73d411524567ba0a8b522fbc0a5c41a45720c
    Author: David Gow <david@ingeniumdigital.com>
    Date:   Mon May 29 15:36:59 2023 +0800

        pipewire: Set 'application.id' if SDL_HINT_APP_ID set

        If SDL_HINT_APP_ID is set, pass it as the application.id to pipewire.
        This gives any pipewire-based tools a hint to find an associated
        .desktop file for icons, etc.

    commit f74549ef2ea6e8067261f0e3dceb1f2bdfdce6c7
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sun May 28 19:23:56 2023 -0700

        Fixed build warning

        (cherry picked from commit 5007b963639bff2fa3359abbfe20d53ea9111fd9)

    commit 1da5b2e488cc53534de939ae3c56e5cca7230f73
    Author: Sam Lantinga <slouken@libsdl.org>
    Date:   Sun May 28 18:41:21 2023 -0700

        Disable SDL_JOYSTICK_RAWINPUT_XINPUT

        Apparently when using the Xbox One Wireless Adapter, using XInput at the same time as raw input will cause the controller to turn off immediately after connecting. This appears to be a bug in the Windows 11 driver stack, but since WGI provides all the extended functionality we need, this can be turned off for now.

        Fixes https://github.com/libsdl-org/SDL/issues/3468

        (cherry picked from commit b2e88ecfeb5e4d7db021e43c1b9bc4c9d14f615c)

    commit 95f244598bb17455dc7651b0f588965e5c351086
    Author: Ryan C. Gordon <icculus@icculus.org>
    Date:   Thu May 18 13:26:55 2023 -0400

        power: On Linux, compare status strings as case-insensitive.

        In case something reports "Device" when we expected "device", etc.

        Reference Issue #6835.

        (cherry picked from commit df9d0fb332ea65c3fc47f72574851c91da2c912b)

    commit 2f75596d5a531f731f2128a8b08ba8c036582382
    Author: Frank Praznik <frank.praznik@gmail.com>
    Date:   Thu May 25 20:37:49 2023 -0400

        Consolidate the X11 WM_CLASS and Wayland app ID envvars

        Consolidate the X11_WMCLASS and WAYLAND_WMCLASS envvars into one SDL_HINT_APP_ID hint. This hint serves the same purpose on both windowing systems to allow desktop compositors to identify and group windows together, as well as associate applications with their desktop settings and icons.

        The common code for retrieving the value is now consolidated under core/unix/SDL_appid.c as it's common to *nix platforms, and the value is now retrieved at window creation time instead of being cached by the video driver at startup so that changes to the hint after video initialization and before window creation will be seen, as well as to accommodate cases where applications want to use different values for different windows.

commit 2f4076aba3521c2969bb0d0106b03fa62cc8e61f
Author: Sylvain <sylvain.becker@gmail.com>
Date:   Sun May 28 22:24:33 2023 +0200

    Add SDL Video Capture, with back-end for linux/macos/ios/android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants