Path: blob/master/thirdparty/sdl/patches/0001-remove-unnecessary-subsystems.patch
22071 views
diff --git a/thirdparty/sdl/SDL.c b/thirdparty/sdl/SDL.c1index 46a74aafdb..3dad7e29ba 1006442--- a/thirdparty/sdl/SDL.c3+++ b/thirdparty/sdl/SDL.c4@@ -40,23 +40,14 @@5#include "SDL_hints_c.h"6#include "SDL_log_c.h"7#include "SDL_properties_c.h"8-#include "audio/SDL_sysaudio.h"9-#include "camera/SDL_camera_c.h"10-#include "cpuinfo/SDL_cpuinfo_c.h"11+//#include "audio/SDL_sysaudio.h"12#include "events/SDL_events_c.h"13#include "haptic/SDL_haptic_c.h"14#include "joystick/SDL_gamepad_c.h"15#include "joystick/SDL_joystick_c.h"16-#include "render/SDL_sysrender.h"17#include "sensor/SDL_sensor_c.h"18#include "stdlib/SDL_getenv_c.h"19#include "thread/SDL_thread_c.h"20-#include "tray/SDL_tray_utils.h"21-#include "video/SDL_pixels_c.h"22-#include "video/SDL_surface_c.h"23-#include "video/SDL_video_c.h"24-#include "filesystem/SDL_filesystem_c.h"25-#include "io/SDL_asyncio_c.h"26#ifdef SDL_PLATFORM_ANDROID27#include "core/android/SDL_android.h"28#endif29@@ -278,7 +269,7 @@ void SDL_InitMainThread(void)30SDL_InitTLSData();31SDL_InitEnvironment();32SDL_InitTicks();33- SDL_InitFilesystem();34+ //SDL_InitFilesystem();3536if (!done_info) {37const char *value;38@@ -297,7 +288,7 @@ void SDL_InitMainThread(void)3940static void SDL_QuitMainThread(void)41{42- SDL_QuitFilesystem();43+ //SDL_QuitFilesystem();44SDL_QuitTicks();45SDL_QuitEnvironment();46SDL_QuitTLSData();47@@ -657,21 +648,21 @@ void SDL_Quit(void)48SDL_HelperWindowDestroy();49#endif50SDL_QuitSubSystem(SDL_INIT_EVERYTHING);51- SDL_CleanupTrays();52+ //SDL_CleanupTrays();5354#ifdef SDL_USE_LIBDBUS55SDL_DBus_Quit();56#endif5758SDL_QuitTimers();59- SDL_QuitAsyncIO();60+ //SDL_QuitAsyncIO();6162SDL_SetObjectsInvalid();63SDL_AssertionsQuit();6465- SDL_QuitPixelFormatDetails();66+ //SDL_QuitPixelFormatDetails();6768- SDL_QuitCPUInfo();69+ //SDL_QuitCPUInfo();7071/* Now that every subsystem has been quit, we reset the subsystem refcount72* and the list of initialized subsystems.73diff --git a/thirdparty/sdl/SDL_assert.c b/thirdparty/sdl/SDL_assert.c74index 2440d04b1e..af904039a4 10064475--- a/thirdparty/sdl/SDL_assert.c76+++ b/thirdparty/sdl/SDL_assert.c77@@ -25,7 +25,7 @@78#endif7980#include "SDL_assert_c.h"81-#include "video/SDL_sysvideo.h"82+//#include "video/SDL_sysvideo.h"8384#if defined(SDL_PLATFORM_WINDOWS)85#ifndef WS_OVERLAPPEDWINDOW86@@ -209,18 +209,6 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v87}88}8990- // Leave fullscreen mode, if possible (scary!)91- window = SDL_GetToplevelForKeyboardFocus();92- if (window) {93- if (window->fullscreen_exclusive) {94- SDL_MinimizeWindow(window);95- } else {96- // !!! FIXME: ungrab the input if we're not fullscreen?97- // No need to mess with the window98- window = NULL;99- }100- }101-102// Show a messagebox if we can, otherwise fall back to stdio103SDL_zero(messagebox);104messagebox.flags = SDL_MESSAGEBOX_WARNING;105@@ -230,7 +218,8 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v106messagebox.numbuttons = SDL_arraysize(buttons);107messagebox.buttons = buttons;108109- if (SDL_ShowMessageBox(&messagebox, &selected)) {110+ //if (SDL_ShowMessageBox(&messagebox, &selected)) {111+ if (false) {112if (selected == -1) {113state = SDL_ASSERTION_IGNORE;114} else {115@@ -311,13 +300,13 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v116}117}118#else119- SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, "Assertion Failed", message, window);120+ //SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, "Assertion Failed", message, window);121#endif // HAVE_STDIO_H122}123124// Re-enter fullscreen mode125if (window) {126- SDL_RestoreWindow(window);127+ //SDL_RestoreWindow(window);128}129130if (message != stack_buf) {131diff --git a/thirdparty/sdl/SDL_internal.h b/thirdparty/sdl/SDL_internal.h132index 8fcd96a7fa..20ec0fcb91 100644133--- a/thirdparty/sdl/SDL_internal.h134+++ b/thirdparty/sdl/SDL_internal.h135@@ -62,7 +62,7 @@136137#include "SDL_build_config.h"138139-#include "dynapi/SDL_dynapi.h"140+//#include "dynapi/SDL_dynapi.h"141142#if SDL_DYNAMIC_API143#include "dynapi/SDL_dynapi_overrides.h"144diff --git a/thirdparty/sdl/SDL_properties.c b/thirdparty/sdl/SDL_properties.c145index 166ea0f918..42d4845458 100644146--- a/thirdparty/sdl/SDL_properties.c147+++ b/thirdparty/sdl/SDL_properties.c148@@ -409,7 +409,7 @@ static void SDLCALL CleanupSurface(void *userdata, void *value)149{150SDL_Surface *surface = (SDL_Surface *)value;151152- SDL_DestroySurface(surface);153+ //SDL_DestroySurface(surface);154}155156bool SDL_SetSurfaceProperty(SDL_PropertiesID props, const char *name, SDL_Surface *surface)157diff --git a/thirdparty/sdl/core/linux/SDL_evdev.c b/thirdparty/sdl/core/linux/SDL_evdev.c158index 5746e2ef98..04e3e9d6b6 100644159--- a/thirdparty/sdl/core/linux/SDL_evdev.c160+++ b/thirdparty/sdl/core/linux/SDL_evdev.c161@@ -39,7 +39,6 @@162#include <linux/input.h>163164#include "../../events/SDL_events_c.h"165-#include "../../events/SDL_scancode_tables_c.h"166#include "../../core/linux/SDL_evdev_capabilities.h"167#include "../../core/linux/SDL_udev.h"168169@@ -221,7 +220,7 @@ bool SDL_EVDEV_Init(void)170SDL_EVDEV_UpdateKeyboardMute();171}172173- SDL_GetMouse()->SetRelativeMouseMode = SDL_EVDEV_SetRelativeMouseMode;174+ //SDL_GetMouse()->SetRelativeMouseMode = SDL_EVDEV_SetRelativeMouseMode;175176_this->ref_count += 1;177178@@ -328,7 +327,7 @@ void SDL_EVDEV_Poll(void)179180SDL_EVDEV_kbd_update(_this->kbd);181182- mouse = SDL_GetMouse();183+ mouse = NULL; //SDL_GetMouse();184185for (item = _this->first; item; item = item->next) {186while ((len = read(item->fd, events, sizeof(events))) > 0) {187@@ -345,10 +344,11 @@ void SDL_EVDEV_Poll(void)188189switch (event->type) {190case EV_KEY:191+ break;192if (event->code >= BTN_MOUSE && event->code < BTN_MOUSE + SDL_arraysize(EVDEV_MouseButtons)) {193Uint64 timestamp = SDL_EVDEV_GetEventTimestamp(event);194mouse_button = event->code - BTN_MOUSE;195- SDL_SendMouseButton(timestamp, mouse->focus, (SDL_MouseID)item->fd, EVDEV_MouseButtons[mouse_button], (event->value != 0));196+ //SDL_SendMouseButton(timestamp, mouse->focus, (SDL_MouseID)item->fd, EVDEV_MouseButtons[mouse_button], (event->value != 0));197break;198}199200@@ -371,11 +371,11 @@ void SDL_EVDEV_Poll(void)201{202Uint64 timestamp = SDL_EVDEV_GetEventTimestamp(event);203scancode = SDL_EVDEV_translate_keycode(event->code);204- if (event->value == 0) {205- SDL_SendKeyboardKey(timestamp, (SDL_KeyboardID)item->fd, event->code, scancode, false);206- } else if (event->value == 1 || event->value == 2 /* key repeated */) {207- SDL_SendKeyboardKey(timestamp, (SDL_KeyboardID)item->fd, event->code, scancode, true);208- }209+ // if (event->value == 0) {210+ // SDL_SendKeyboardKey(timestamp, (SDL_KeyboardID)item->fd, event->code, scancode, false);211+ // } else if (event->value == 1 || event->value == 2 /* key repeated */) {212+ // SDL_SendKeyboardKey(timestamp, (SDL_KeyboardID)item->fd, event->code, scancode, true);213+ // }214SDL_EVDEV_kbd_keycode(_this->kbd, event->code, event->value);215}216break;217@@ -490,36 +490,30 @@ void SDL_EVDEV_Poll(void)218if (item->relative_mouse) {219if (item->mouse_x != 0 || item->mouse_y != 0) {220Uint64 timestamp = SDL_EVDEV_GetEventTimestamp(event);221- SDL_SendMouseMotion(timestamp, mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse, (float)item->mouse_x, (float)item->mouse_y);222+ //SDL_SendMouseMotion(timestamp, mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse, (float)item->mouse_x, (float)item->mouse_y);223item->mouse_x = item->mouse_y = 0;224}225} else if (item->range_x > 0 && item->range_y > 0) {226int screen_w = 0, screen_h = 0;227const SDL_DisplayMode *mode = NULL;228229- if (mouse->focus) {230- mode = SDL_GetCurrentDisplayMode(SDL_GetDisplayForWindow(mouse->focus));231- }232- if (!mode) {233- mode = SDL_GetCurrentDisplayMode(SDL_GetPrimaryDisplay());234- }235if (mode) {236screen_w = mode->w;237screen_h = mode->h;238}239- SDL_SendMouseMotion(SDL_EVDEV_GetEventTimestamp(event), mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse,240- (float)(item->mouse_x - item->min_x) * screen_w / item->range_x,241- (float)(item->mouse_y - item->min_y) * screen_h / item->range_y);242+ //SDL_SendMouseMotion(SDL_EVDEV_GetEventTimestamp(event), mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse,243+ // (float)(item->mouse_x - item->min_x) * screen_w / item->range_x,244+ // (float)(item->mouse_y - item->min_y) * screen_h / item->range_y);245}246247if (item->mouse_wheel != 0 || item->mouse_hwheel != 0) {248Uint64 timestamp = SDL_EVDEV_GetEventTimestamp(event);249const float denom = (item->high_res_hwheel ? 120.0f : 1.0f);250- SDL_SendMouseWheel(timestamp,251- mouse->focus, (SDL_MouseID)item->fd,252- item->mouse_hwheel / denom,253- item->mouse_wheel / denom,254- SDL_MOUSEWHEEL_NORMAL);255+ //SDL_SendMouseWheel(timestamp,256+ // mouse->focus, (SDL_MouseID)item->fd,257+ // item->mouse_hwheel / denom,258+ // item->mouse_wheel / denom,259+ // SDL_MOUSEWHEEL_NORMAL);260item->mouse_wheel = item->mouse_hwheel = 0;261}262263@@ -546,16 +540,16 @@ void SDL_EVDEV_Poll(void)264* be window-relative in that case. */265switch (item->touchscreen_data->slots[j].delta) {266case EVDEV_TOUCH_SLOTDELTA_DOWN:267- SDL_SendTouch(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, SDL_EVENT_FINGER_DOWN, norm_x, norm_y, norm_pressure);268+ //SDL_SendTouch(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, SDL_EVENT_FINGER_DOWN, norm_x, norm_y, norm_pressure);269item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;270break;271case EVDEV_TOUCH_SLOTDELTA_UP:272- SDL_SendTouch(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, SDL_EVENT_FINGER_UP, norm_x, norm_y, norm_pressure);273+ //SDL_SendTouch(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, SDL_EVENT_FINGER_UP, norm_x, norm_y, norm_pressure);274item->touchscreen_data->slots[j].tracking_id = 0;275item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;276break;277case EVDEV_TOUCH_SLOTDELTA_MOVE:278- SDL_SendTouchMotion(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, norm_x, norm_y, norm_pressure);279+ //SDL_SendTouchMotion(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, norm_x, norm_y, norm_pressure);280item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;281break;282default:283@@ -585,7 +579,7 @@ void SDL_EVDEV_Poll(void)284285static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode)286{287- SDL_Scancode scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_LINUX, keycode);288+ //SDL_Scancode scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_LINUX, keycode);289290#ifdef DEBUG_SCANCODES291if (scancode == SDL_SCANCODE_UNKNOWN) {292@@ -602,7 +596,7 @@ static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode)293}294#endif // DEBUG_SCANCODES295296- return scancode;297+ return 0; //scancode;298}299300static bool SDL_EVDEV_init_keyboard(SDL_evdevlist_item *item, int udev_class)301@@ -612,14 +606,14 @@ static bool SDL_EVDEV_init_keyboard(SDL_evdevlist_item *item, int udev_class)302name[0] = '\0';303ioctl(item->fd, EVIOCGNAME(sizeof(name)), name);304305- SDL_AddKeyboard((SDL_KeyboardID)item->fd, name, true);306+ //SDL_AddKeyboard((SDL_KeyboardID)item->fd, name, true);307308return true;309}310311static void SDL_EVDEV_destroy_keyboard(SDL_evdevlist_item *item)312{313- SDL_RemoveKeyboard((SDL_KeyboardID)item->fd, true);314+ //SDL_RemoveKeyboard((SDL_KeyboardID)item->fd, true);315}316317static bool SDL_EVDEV_init_mouse(SDL_evdevlist_item *item, int udev_class)318@@ -631,7 +625,7 @@ static bool SDL_EVDEV_init_mouse(SDL_evdevlist_item *item, int udev_class)319name[0] = '\0';320ioctl(item->fd, EVIOCGNAME(sizeof(name)), name);321322- SDL_AddMouse((SDL_MouseID)item->fd, name, true);323+ //SDL_AddMouse((SDL_MouseID)item->fd, name, true);324325ret = ioctl(item->fd, EVIOCGABS(ABS_X), &abs_info);326if (ret < 0) {327@@ -656,7 +650,7 @@ static bool SDL_EVDEV_init_mouse(SDL_evdevlist_item *item, int udev_class)328329static void SDL_EVDEV_destroy_mouse(SDL_evdevlist_item *item)330{331- SDL_RemoveMouse((SDL_MouseID)item->fd, true);332+ //SDL_RemoveMouse((SDL_MouseID)item->fd, true);333}334335static bool SDL_EVDEV_init_touchscreen(SDL_evdevlist_item *item, int udev_class)336@@ -743,9 +737,10 @@ static bool SDL_EVDEV_init_touchscreen(SDL_evdevlist_item *item, int udev_class)337return false;338}339340- ret = SDL_AddTouch(item->fd, // I guess our fd is unique enough341- (udev_class & SDL_UDEV_DEVICE_TOUCHPAD) ? SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE : SDL_TOUCH_DEVICE_DIRECT,342- item->touchscreen_data->name);343+ //ret = SDL_AddTouch(item->fd, // I guess our fd is unique enough344+ // (udev_class & SDL_UDEV_DEVICE_TOUCHPAD) ? SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE : SDL_TOUCH_DEVICE_DIRECT,345+ // item->touchscreen_data->name);346+ ret = -1;347if (ret < 0) {348SDL_free(item->touchscreen_data->slots);349SDL_free(item->touchscreen_data->name);350@@ -762,7 +757,7 @@ static void SDL_EVDEV_destroy_touchscreen(SDL_evdevlist_item *item)351return;352}353354- SDL_DelTouch(item->fd);355+ //SDL_DelTouch(item->fd);356SDL_free(item->touchscreen_data->slots);357SDL_free(item->touchscreen_data->name);358SDL_free(item->touchscreen_data);359diff --git a/thirdparty/sdl/events/SDL_events.c b/thirdparty/sdl/events/SDL_events.c360index 81220a1787..7ca683e0eb 100644361--- a/thirdparty/sdl/events/SDL_events.c362+++ b/thirdparty/sdl/events/SDL_events.c363@@ -24,10 +24,7 @@364365#include "SDL_events_c.h"366#include "SDL_eventwatch_c.h"367-#include "SDL_windowevents_c.h"368#include "../SDL_hints_c.h"369-#include "../audio/SDL_audio_c.h"370-#include "../camera/SDL_camera_c.h"371#include "../timer/SDL_timer_c.h"372#ifndef SDL_JOYSTICK_DISABLED373#include "../joystick/SDL_joystick_c.h"374@@ -35,7 +32,7 @@375#ifndef SDL_SENSOR_DISABLED376#include "../sensor/SDL_sensor_c.h"377#endif378-#include "../video/SDL_sysvideo.h"379+//#include "../video/SDL_sysvideo.h"380381#ifdef SDL_PLATFORM_ANDROID382#include "../core/android/SDL_android.h"383@@ -930,7 +927,7 @@ void SDL_StopEventLoop(void)384}385386SDL_QuitEventWatchList(&SDL_event_watchers);387- SDL_QuitWindowEventWatch();388+ //SDL_QuitWindowEventWatch();389390SDL_Mutex *lock = NULL;391if (SDL_EventQ.lock) {392@@ -970,7 +967,7 @@ bool SDL_StartEventLoop(void)393}394#endif // !SDL_THREADS_DISABLED395396- SDL_InitWindowEventWatch();397+ //SDL_InitWindowEventWatch();398399SDL_EventQ.active = true;400401@@ -1071,17 +1068,6 @@ static void SDL_SendWakeupEvent(void)402{403#ifdef SDL_PLATFORM_ANDROID404Android_SendLifecycleEvent(SDL_ANDROID_LIFECYCLE_WAKE);405-#else406- SDL_VideoDevice *_this = SDL_GetVideoDevice();407- if (_this == NULL || !_this->SendWakeupEvent) {408- return;409- }410-411- // We only want to do this once while waiting for an event, so set it to NULL atomically here412- SDL_Window *wakeup_window = (SDL_Window *)SDL_SetAtomicPointer(&_this->wakeup_window, NULL);413- if (wakeup_window) {414- _this->SendWakeupEvent(_this, wakeup_window);415- }416#endif417}418419@@ -1421,9 +1407,9 @@ void SDL_PumpEventMaintenance(void)420}421#endif422423- SDL_UpdateTrays();424+ //SDL_UpdateTrays();425426- SDL_SendPendingSignalEvents(); // in case we had a signal handler fire, etc.427+ //SDL_SendPendingSignalEvents(); // in case we had a signal handler fire, etc.428}429430// Run the system dependent event loops431@@ -1433,7 +1419,7 @@ static void SDL_PumpEventsInternal(bool push_sentinel)432SDL_FreeTemporaryMemory();433434// Release any keys held down from last frame435- SDL_ReleaseAutoReleaseKeys();436+ //SDL_ReleaseAutoReleaseKeys();437438// Run any pending main thread callbacks439SDL_RunMainThreadCallbacks();440@@ -1441,12 +1427,6 @@ static void SDL_PumpEventsInternal(bool push_sentinel)441#ifdef SDL_PLATFORM_ANDROID442// Android event processing is independent of the video subsystem443Android_PumpEvents(0);444-#else445- // Get events from the video subsystem446- SDL_VideoDevice *_this = SDL_GetVideoDevice();447- if (_this) {448- _this->PumpEvents(_this);449- }450#endif451452SDL_PumpEventMaintenance();453@@ -1477,103 +1457,6 @@ bool SDL_PollEvent(SDL_Event *event)454return SDL_WaitEventTimeoutNS(event, 0);455}456457-#ifndef SDL_PLATFORM_ANDROID458-459-static Sint64 SDL_events_get_polling_interval(void)460-{461- Sint64 poll_intervalNS = SDL_MAX_SINT64;462-463-#ifndef SDL_JOYSTICK_DISABLED464- if (SDL_WasInit(SDL_INIT_JOYSTICK) && SDL_update_joysticks) {465- if (SDL_JoysticksOpened()) {466- // If we have joysticks open, we need to poll rapidly for events467- poll_intervalNS = SDL_min(poll_intervalNS, EVENT_POLL_INTERVAL_NS);468- } else {469- // If not, just poll every few seconds to enumerate new joysticks470- poll_intervalNS = SDL_min(poll_intervalNS, ENUMERATION_POLL_INTERVAL_NS);471- }472- }473-#endif474-475-#ifndef SDL_SENSOR_DISABLED476- if (SDL_WasInit(SDL_INIT_SENSOR) && SDL_update_sensors && SDL_SensorsOpened()) {477- // If we have sensors open, we need to poll rapidly for events478- poll_intervalNS = SDL_min(poll_intervalNS, EVENT_POLL_INTERVAL_NS);479- }480-#endif481-482- return poll_intervalNS;483-}484-485-static int SDL_WaitEventTimeout_Device(SDL_VideoDevice *_this, SDL_Window *wakeup_window, SDL_Event *event, Uint64 start, Sint64 timeoutNS)486-{487- Sint64 loop_timeoutNS = timeoutNS;488- Sint64 poll_intervalNS = SDL_events_get_polling_interval();489-490- for (;;) {491- int status;492- /* Pump events on entry and each time we wake to ensure:493- a) All pending events are batch processed after waking up from a wait494- b) Waiting can be completely skipped if events are already available to be pumped495- c) Periodic processing that takes place in some platform PumpEvents() functions happens496- d) Signals received in WaitEventTimeout() are turned into SDL events497- */498- SDL_PumpEventsInternal(true);499-500- status = SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_EVENT_FIRST, SDL_EVENT_LAST);501- if (status < 0) {502- // Got an error: return503- break;504- }505- if (status > 0) {506- // There is an event, we can return.507- return 1;508- }509- // No events found in the queue, call WaitEventTimeout to wait for an event.510- if (timeoutNS > 0) {511- Sint64 elapsed = SDL_GetTicksNS() - start;512- if (elapsed >= timeoutNS) {513- return 0;514- }515- loop_timeoutNS = (timeoutNS - elapsed);516- }517- // Adjust the timeout for any polling requirements we currently have.518- if (poll_intervalNS != SDL_MAX_SINT64) {519- if (loop_timeoutNS >= 0) {520- loop_timeoutNS = SDL_min(loop_timeoutNS, poll_intervalNS);521- } else {522- loop_timeoutNS = poll_intervalNS;523- }524- }525- SDL_SetAtomicPointer(&_this->wakeup_window, wakeup_window);526- status = _this->WaitEventTimeout(_this, loop_timeoutNS);527- SDL_SetAtomicPointer(&_this->wakeup_window, NULL);528- if (status == 0 && poll_intervalNS != SDL_MAX_SINT64 && loop_timeoutNS == poll_intervalNS) {529- // We may have woken up to poll. Try again530- continue;531- } else if (status <= 0) {532- // There is either an error or the timeout is elapsed: return533- return status;534- }535- /* An event was found and pumped into the SDL events queue. Continue the loop536- to let SDL_PeepEvents pick it up .*/537- }538- return 0;539-}540-541-static SDL_Window *SDL_find_active_window(SDL_VideoDevice *_this)542-{543- SDL_Window *window;544- for (window = _this->windows; window; window = window->next) {545- if (!window->is_destroying) {546- return window;547- }548- }549- return NULL;550-}551-552-#endif // !SDL_PLATFORM_ANDROID553-554bool SDL_WaitEvent(SDL_Event *event)555{556return SDL_WaitEventTimeoutNS(event, -1);557@@ -1665,24 +1548,6 @@ bool SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS)558Android_PumpEvents(delay);559}560#else561- SDL_VideoDevice *_this = SDL_GetVideoDevice();562- if (_this && _this->WaitEventTimeout && _this->SendWakeupEvent) {563- // Look if a shown window is available to send the wakeup event.564- SDL_Window *wakeup_window = SDL_find_active_window(_this);565- if (wakeup_window) {566- result = SDL_WaitEventTimeout_Device(_this, wakeup_window, event, start, timeoutNS);567- if (result > 0) {568- return true;569- } else if (result == 0) {570- return false;571- } else {572- /* There may be implementation-defined conditions where the backend cannot573- * reliably wait for the next event. If that happens, fall back to polling.574- */575- }576- }577- }578-579for (;;) {580SDL_PumpEventsInternal(true);581582@@ -1855,7 +1720,7 @@ void SDL_SetEventEnabled(Uint32 type, bool enabled)583/* turn off drag'n'drop support if we've disabled the events.584This might change some UI details at the OS level. */585if (type == SDL_EVENT_DROP_FILE || type == SDL_EVENT_DROP_TEXT) {586- SDL_ToggleDragAndDropSupport();587+ //SDL_ToggleDragAndDropSupport();588}589}590}591@@ -1947,14 +1812,14 @@ bool SDL_InitEvents(void)592return false;593}594595- SDL_InitQuit();596+ //SDL_InitQuit();597598return true;599}600601void SDL_QuitEvents(void)602{603- SDL_QuitQuit();604+ //SDL_QuitQuit();605SDL_StopEventLoop();606SDL_QuitMainThreadCallbacks();607SDL_RemoveHintCallback(SDL_HINT_POLL_SENTINEL, SDL_PollSentinelChanged, NULL);608diff --git a/thirdparty/sdl/events/SDL_events_c.h b/thirdparty/sdl/events/SDL_events_c.h609index e56ac475e5..f3a0744d1c 100644610--- a/thirdparty/sdl/events/SDL_events_c.h611+++ b/thirdparty/sdl/events/SDL_events_c.h612@@ -25,16 +25,9 @@613#include "SDL_internal.h"614615// Useful functions and variables from SDL_events.c616-#include "../video/SDL_sysvideo.h"617+//#include "../video/SDL_sysvideo.h"618619-#include "SDL_clipboardevents_c.h"620-#include "SDL_displayevents_c.h"621-#include "SDL_dropevents_c.h"622-#include "SDL_keyboard_c.h"623#include "SDL_mouse_c.h"624-#include "SDL_touch_c.h"625-#include "SDL_pen_c.h"626-#include "SDL_windowevents_c.h"627628// Start and stop the event processing loop629extern bool SDL_StartEventLoop(void);630diff --git a/thirdparty/sdl/include/SDL3/SDL.h b/thirdparty/sdl/include/SDL3/SDL.h631index 7ec527b6d0..c99997044b 100644632--- a/thirdparty/sdl/include/SDL3/SDL.h633+++ b/thirdparty/sdl/include/SDL3/SDL.h634@@ -47,7 +47,7 @@635#include <SDL3/SDL_events.h>636#include <SDL3/SDL_filesystem.h>637#include <SDL3/SDL_gamepad.h>638-#include <SDL3/SDL_gpu.h>639+//#include <SDL3/SDL_gpu.h>640#include <SDL3/SDL_guid.h>641#include <SDL3/SDL_haptic.h>642#include <SDL3/SDL_hidapi.h>643@@ -85,6 +85,6 @@644#include <SDL3/SDL_touch.h>645#include <SDL3/SDL_version.h>646#include <SDL3/SDL_video.h>647-#include <SDL3/SDL_oldnames.h>648+//#include <SDL3/SDL_oldnames.h>649650#endif /* SDL_h_ */651diff --git a/thirdparty/sdl/joystick/SDL_joystick.c b/thirdparty/sdl/joystick/SDL_joystick.c652index 5ce36de867..090dc07303 100644653--- a/thirdparty/sdl/joystick/SDL_joystick.c654+++ b/thirdparty/sdl/joystick/SDL_joystick.c655@@ -29,7 +29,7 @@656#include "SDL_steam_virtual_gamepad.h"657658#include "../events/SDL_events_c.h"659-#include "../video/SDL_sysvideo.h"660+//#include "../video/SDL_sysvideo.h"661#include "../sensor/SDL_sensor_c.h"662#include "hidapi/SDL_hidapijoystick_c.h"663664@@ -1014,7 +1014,8 @@ static void AttemptSensorFusion(SDL_Joystick *joystick, bool invert_sensors)665When a phone is being used as a gamepad, its orientation changes,666so adjust sensor axes to match.667*/668- if (SDL_GetNaturalDisplayOrientation(SDL_GetPrimaryDisplay()) == SDL_ORIENTATION_LANDSCAPE) {669+ //if (SDL_GetNaturalDisplayOrientation(SDL_GetPrimaryDisplay()) == SDL_ORIENTATION_LANDSCAPE) {670+ if (true) {671/* When a device in landscape orientation is laid flat, the axes change672orientation as follows:673-X to +X becomes -X to +X674@@ -2071,11 +2072,6 @@ static bool SDL_PrivateJoystickShouldIgnoreEvent(void)675if (SDL_joystick_allows_background_events) {676return false;677}678-679- if (SDL_HasWindows() && SDL_GetKeyboardFocus() == NULL) {680- // We have windows but we don't have focus, ignore the event.681- return true;682- }683return false;684}685686687688