Moved Android event initialization to SDL_InitEvents()

This commit is contained in:
Sam Lantinga 2024-07-25 08:33:11 -07:00
parent 53022aeb5e
commit 42650d79c1
2 changed files with 6 additions and 9 deletions

View file

@ -52,7 +52,6 @@
#include "thread/SDL_thread_c.h"
#include "video/SDL_pixels_c.h"
#include "video/SDL_video_c.h"
#include "video/android/SDL_androidevents.h"
#include "filesystem/SDL_filesystem_c.h"
#define SDL_INIT_EVERYTHING ~0U
@ -226,10 +225,6 @@ int SDL_InitSubSystem(Uint32 flags)
SDL_InitMainThread();
#ifdef SDL_PLATFORM_ANDROID
Android_InitEvents();
#endif
#ifdef SDL_USE_LIBDBUS
SDL_DBus_Init();
#endif
@ -576,10 +571,6 @@ void SDL_Quit(void)
SDL_DBus_Quit();
#endif
#ifdef SDL_PLATFORM_ANDROID
Android_QuitEvents();
#endif
SDL_SetObjectsInvalid();
SDL_ClearHints();
SDL_AssertionsQuit();

View file

@ -1788,6 +1788,9 @@ int SDL_SendSystemThemeChangedEvent(void)
int SDL_InitEvents(void)
{
#ifdef SDL_PLATFORM_ANDROID
Android_InitEvents();
#endif
#ifndef SDL_JOYSTICK_DISABLED
SDL_AddHintCallback(SDL_HINT_AUTO_UPDATE_JOYSTICKS, SDL_AutoUpdateJoysticksChanged, NULL);
#endif
@ -1818,4 +1821,7 @@ void SDL_QuitEvents(void)
#ifndef SDL_SENSOR_DISABLED
SDL_DelHintCallback(SDL_HINT_AUTO_UPDATE_SENSORS, SDL_AutoUpdateSensorsChanged, NULL);
#endif
#ifdef SDL_PLATFORM_ANDROID
Android_QuitEvents();
#endif
}