Path: blob/master/thirdparty/sdl/patches/0001-remove-unnecessary-subsystems.patch
9898 views
diff --git a/thirdparty/sdl/SDL.c b/thirdparty/sdl/SDL.c1index 502f6617a4..dd0b823634 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/core/linux/SDL_fcitx.c b/thirdparty/sdl/core/linux/SDL_fcitx.c360index d7a9ed6656..c6bce5f796 100644361--- a/thirdparty/sdl/core/linux/SDL_fcitx.c362+++ b/thirdparty/sdl/core/linux/SDL_fcitx.c363@@ -23,8 +23,7 @@364#include <unistd.h>365366#include "SDL_fcitx.h"367-#include "../../video/SDL_sysvideo.h"368-#include "../../events/SDL_keyboard_c.h"369+//#include "../../video/SDL_sysvideo.h"370#include "SDL_dbus.h"371372#ifdef SDL_VIDEO_DRIVER_X11373@@ -192,7 +191,7 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m374dbus->message_iter_init(msg, &iter);375dbus->message_iter_get_basic(&iter, &text);376377- SDL_SendKeyboardText(text);378+ //SDL_SendKeyboardText(text);379380return DBUS_HANDLER_RESULT_HANDLED;381}382@@ -206,13 +205,13 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m383Sint32 byte_pos = Fcitx_GetPreeditCursorByte(dbus, msg);384start_pos = byte_pos >= 0 ? SDL_utf8strnlen(text, byte_pos) : -1;385}386- SDL_SendEditingText(text, start_pos, end_pos >= 0 ? end_pos - start_pos : -1);387+ //SDL_SendEditingText(text, start_pos, end_pos >= 0 ? end_pos - start_pos : -1);388SDL_free(text);389} else {390- SDL_SendEditingText("", 0, 0);391+ //SDL_SendEditingText("", 0, 0);392}393394- SDL_Fcitx_UpdateTextInputArea(SDL_GetKeyboardFocus());395+ //SDL_Fcitx_UpdateTextInputArea(SDL_GetKeyboardFocus());396return DBUS_HANDLER_RESULT_HANDLED;397}398399@@ -394,7 +393,7 @@ bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, bool down)400DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &keycode, DBUS_TYPE_UINT32, &mod_state, DBUS_TYPE_BOOLEAN, &is_release, DBUS_TYPE_UINT32, &event_time, DBUS_TYPE_INVALID,401DBUS_TYPE_BOOLEAN, &handled, DBUS_TYPE_INVALID)) {402if (handled) {403- SDL_Fcitx_UpdateTextInputArea(SDL_GetKeyboardFocus());404+ //SDL_Fcitx_UpdateTextInputArea(SDL_GetKeyboardFocus());405return true;406}407}408@@ -402,51 +401,6 @@ bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, bool down)409return false;410}411412-void SDL_Fcitx_UpdateTextInputArea(SDL_Window *window)413-{414- int x = 0, y = 0;415- SDL_Rect *cursor = &fcitx_client.cursor_rect;416-417- if (!window) {418- return;419- }420-421- // We'll use a square at the text input cursor location for the cursor_rect422- cursor->x = window->text_input_rect.x + window->text_input_cursor;423- cursor->y = window->text_input_rect.y;424- cursor->w = window->text_input_rect.h;425- cursor->h = window->text_input_rect.h;426-427- SDL_GetWindowPosition(window, &x, &y);428-429-#ifdef SDL_VIDEO_DRIVER_X11430- {431- SDL_PropertiesID props = SDL_GetWindowProperties(window);432- Display *x_disp = (Display *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL);433- int x_screen = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, 0);434- Window x_win = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0);435- Window unused;436- if (x_disp && x_win) {437- X11_XTranslateCoordinates(x_disp, x_win, RootWindow(x_disp, x_screen), 0, 0, &x, &y, &unused);438- }439- }440-#endif441-442- if (cursor->x == -1 && cursor->y == -1 && cursor->w == 0 && cursor->h == 0) {443- // move to bottom left444- int w = 0, h = 0;445- SDL_GetWindowSize(window, &w, &h);446- cursor->x = 0;447- cursor->y = h;448- }449-450- x += cursor->x;451- y += cursor->y;452-453- SDL_DBus_CallVoidMethod(FCITX_DBUS_SERVICE, fcitx_client.ic_path, FCITX_IC_DBUS_INTERFACE, "SetCursorRect",454- DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, DBUS_TYPE_INT32, &cursor->w, DBUS_TYPE_INT32, &cursor->h, DBUS_TYPE_INVALID);455-}456-457void SDL_Fcitx_PumpEvents(void)458{459SDL_DBusContext *dbus = fcitx_client.dbus;460diff --git a/thirdparty/sdl/core/linux/SDL_ibus.c b/thirdparty/sdl/core/linux/SDL_ibus.c461index ea58ed5778..3d4bb83694 100644462--- a/thirdparty/sdl/core/linux/SDL_ibus.c463+++ b/thirdparty/sdl/core/linux/SDL_ibus.c464@@ -26,7 +26,7 @@465466#ifdef SDL_USE_LIBDBUS467468-#include "../../video/SDL_sysvideo.h"469+//#include "../../video/SDL_sysvideo.h"470#include "../../events/SDL_keyboard_c.h"471472#ifdef SDL_VIDEO_DRIVER_X11473@@ -261,7 +261,7 @@ static DBusHandlerResult IBus_MessageHandler(DBusConnection *conn, DBusMessage *474}475}476477- SDL_IBus_UpdateTextInputArea(SDL_GetKeyboardFocus());478+ //SDL_IBus_UpdateTextInputArea(SDL_GetKeyboardFocus());479480return DBUS_HANDLER_RESULT_HANDLED;481}482@@ -484,13 +484,6 @@ static bool IBus_SetupConnection(SDL_DBusContext *dbus, const char *addr)483dbus->connection_flush(ibus_conn);484}485486- SDL_Window *window = SDL_GetKeyboardFocus();487- if (SDL_TextInputActive(window)) {488- SDL_IBus_SetFocus(true);489- SDL_IBus_UpdateTextInputArea(window);490- } else {491- SDL_IBus_SetFocus(false);492- }493return result;494}495496@@ -678,53 +671,11 @@ bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, bool down)497}498}499500- SDL_IBus_UpdateTextInputArea(SDL_GetKeyboardFocus());501+ //SDL_IBus_UpdateTextInputArea(SDL_GetKeyboardFocus());502503return (result != 0);504}505506-void SDL_IBus_UpdateTextInputArea(SDL_Window *window)507-{508- int x = 0, y = 0;509- SDL_DBusContext *dbus;510-511- if (!window) {512- return;513- }514-515- // We'll use a square at the text input cursor location for the ibus_cursor516- ibus_cursor_rect.x = window->text_input_rect.x + window->text_input_cursor;517- ibus_cursor_rect.y = window->text_input_rect.y;518- ibus_cursor_rect.w = window->text_input_rect.h;519- ibus_cursor_rect.h = window->text_input_rect.h;520-521- SDL_GetWindowPosition(window, &x, &y);522-523-#ifdef SDL_VIDEO_DRIVER_X11524- {525- SDL_PropertiesID props = SDL_GetWindowProperties(window);526- Display *x_disp = (Display *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL);527- int x_screen = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, 0);528- Window x_win = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0);529- Window unused;530-531- if (x_disp && x_win) {532- X11_XTranslateCoordinates(x_disp, x_win, RootWindow(x_disp, x_screen), 0, 0, &x, &y, &unused);533- }534- }535-#endif536-537- x += ibus_cursor_rect.x;538- y += ibus_cursor_rect.y;539-540- dbus = SDL_DBus_GetContext();541-542- if (IBus_CheckConnection(dbus)) {543- SDL_DBus_CallVoidMethodOnConnection(ibus_conn, ibus_service, input_ctx_path, ibus_input_interface, "SetCursorLocation",544- DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, DBUS_TYPE_INT32, &ibus_cursor_rect.w, DBUS_TYPE_INT32, &ibus_cursor_rect.h, DBUS_TYPE_INVALID);545- }546-}547-548void SDL_IBus_PumpEvents(void)549{550SDL_DBusContext *dbus = SDL_DBus_GetContext();551diff --git a/thirdparty/sdl/core/linux/SDL_system_theme.c b/thirdparty/sdl/core/linux/SDL_system_theme.c552index 6d6087db5a..f5ef92dd05 100644553--- a/thirdparty/sdl/core/linux/SDL_system_theme.c554+++ b/thirdparty/sdl/core/linux/SDL_system_theme.c555@@ -22,7 +22,7 @@556557#include "SDL_dbus.h"558#include "SDL_system_theme.h"559-#include "../../video/SDL_sysvideo.h"560+//#include "../../video/SDL_sysvideo.h"561562#include <unistd.h>563564@@ -99,7 +99,7 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m565if (!DBus_ExtractThemeVariant(&signal_iter, &system_theme_data.theme))566goto not_our_signal;567568- SDL_SetSystemTheme(system_theme_data.theme);569+ //SDL_SetSystemTheme(system_theme_data.theme);570return DBUS_HANDLER_RESULT_HANDLED;571}572not_our_signal:573diff --git a/thirdparty/sdl/events/SDL_events.c b/thirdparty/sdl/events/SDL_events.c574index a151740524..24c2c4270f 100644575--- a/thirdparty/sdl/events/SDL_events.c576+++ b/thirdparty/sdl/events/SDL_events.c577@@ -24,10 +24,7 @@578579#include "SDL_events_c.h"580#include "SDL_eventwatch_c.h"581-#include "SDL_windowevents_c.h"582#include "../SDL_hints_c.h"583-#include "../audio/SDL_audio_c.h"584-#include "../camera/SDL_camera_c.h"585#include "../timer/SDL_timer_c.h"586#ifndef SDL_JOYSTICK_DISABLED587#include "../joystick/SDL_joystick_c.h"588@@ -35,7 +32,7 @@589#ifndef SDL_SENSOR_DISABLED590#include "../sensor/SDL_sensor_c.h"591#endif592-#include "../video/SDL_sysvideo.h"593+//#include "../video/SDL_sysvideo.h"594595#ifdef SDL_PLATFORM_ANDROID596#include "../core/android/SDL_android.h"597@@ -930,7 +927,7 @@ void SDL_StopEventLoop(void)598}599600SDL_QuitEventWatchList(&SDL_event_watchers);601- SDL_QuitWindowEventWatch();602+ //SDL_QuitWindowEventWatch();603604SDL_Mutex *lock = NULL;605if (SDL_EventQ.lock) {606@@ -970,7 +967,7 @@ bool SDL_StartEventLoop(void)607}608#endif // !SDL_THREADS_DISABLED609610- SDL_InitWindowEventWatch();611+ //SDL_InitWindowEventWatch();612613SDL_EventQ.active = true;614615@@ -1071,17 +1068,6 @@ static void SDL_SendWakeupEvent(void)616{617#ifdef SDL_PLATFORM_ANDROID618Android_SendLifecycleEvent(SDL_ANDROID_LIFECYCLE_WAKE);619-#else620- SDL_VideoDevice *_this = SDL_GetVideoDevice();621- if (_this == NULL || !_this->SendWakeupEvent) {622- return;623- }624-625- // We only want to do this once while waiting for an event, so set it to NULL atomically here626- SDL_Window *wakeup_window = (SDL_Window *)SDL_SetAtomicPointer(&_this->wakeup_window, NULL);627- if (wakeup_window) {628- _this->SendWakeupEvent(_this, wakeup_window);629- }630#endif631}632633@@ -1420,9 +1406,9 @@ void SDL_PumpEventMaintenance(void)634}635#endif636637- SDL_UpdateTrays();638+ //SDL_UpdateTrays();639640- SDL_SendPendingSignalEvents(); // in case we had a signal handler fire, etc.641+ //SDL_SendPendingSignalEvents(); // in case we had a signal handler fire, etc.642}643644// Run the system dependent event loops645@@ -1432,7 +1418,7 @@ static void SDL_PumpEventsInternal(bool push_sentinel)646SDL_FreeTemporaryMemory();647648// Release any keys held down from last frame649- SDL_ReleaseAutoReleaseKeys();650+ //SDL_ReleaseAutoReleaseKeys();651652// Run any pending main thread callbacks653SDL_RunMainThreadCallbacks();654@@ -1440,12 +1426,6 @@ static void SDL_PumpEventsInternal(bool push_sentinel)655#ifdef SDL_PLATFORM_ANDROID656// Android event processing is independent of the video subsystem657Android_PumpEvents(0);658-#else659- // Get events from the video subsystem660- SDL_VideoDevice *_this = SDL_GetVideoDevice();661- if (_this) {662- _this->PumpEvents(_this);663- }664#endif665666SDL_PumpEventMaintenance();667@@ -1476,103 +1456,6 @@ bool SDL_PollEvent(SDL_Event *event)668return SDL_WaitEventTimeoutNS(event, 0);669}670671-#ifndef SDL_PLATFORM_ANDROID672-673-static Sint64 SDL_events_get_polling_interval(void)674-{675- Sint64 poll_intervalNS = SDL_MAX_SINT64;676-677-#ifndef SDL_JOYSTICK_DISABLED678- if (SDL_WasInit(SDL_INIT_JOYSTICK) && SDL_update_joysticks) {679- if (SDL_JoysticksOpened()) {680- // If we have joysticks open, we need to poll rapidly for events681- poll_intervalNS = SDL_min(poll_intervalNS, EVENT_POLL_INTERVAL_NS);682- } else {683- // If not, just poll every few seconds to enumerate new joysticks684- poll_intervalNS = SDL_min(poll_intervalNS, ENUMERATION_POLL_INTERVAL_NS);685- }686- }687-#endif688-689-#ifndef SDL_SENSOR_DISABLED690- if (SDL_WasInit(SDL_INIT_SENSOR) && SDL_update_sensors && SDL_SensorsOpened()) {691- // If we have sensors open, we need to poll rapidly for events692- poll_intervalNS = SDL_min(poll_intervalNS, EVENT_POLL_INTERVAL_NS);693- }694-#endif695-696- return poll_intervalNS;697-}698-699-static int SDL_WaitEventTimeout_Device(SDL_VideoDevice *_this, SDL_Window *wakeup_window, SDL_Event *event, Uint64 start, Sint64 timeoutNS)700-{701- Sint64 loop_timeoutNS = timeoutNS;702- Sint64 poll_intervalNS = SDL_events_get_polling_interval();703-704- for (;;) {705- int status;706- /* Pump events on entry and each time we wake to ensure:707- a) All pending events are batch processed after waking up from a wait708- b) Waiting can be completely skipped if events are already available to be pumped709- c) Periodic processing that takes place in some platform PumpEvents() functions happens710- d) Signals received in WaitEventTimeout() are turned into SDL events711- */712- SDL_PumpEventsInternal(true);713-714- status = SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_EVENT_FIRST, SDL_EVENT_LAST);715- if (status < 0) {716- // Got an error: return717- break;718- }719- if (status > 0) {720- // There is an event, we can return.721- return 1;722- }723- // No events found in the queue, call WaitEventTimeout to wait for an event.724- if (timeoutNS > 0) {725- Sint64 elapsed = SDL_GetTicksNS() - start;726- if (elapsed >= timeoutNS) {727- return 0;728- }729- loop_timeoutNS = (timeoutNS - elapsed);730- }731- // Adjust the timeout for any polling requirements we currently have.732- if (poll_intervalNS != SDL_MAX_SINT64) {733- if (loop_timeoutNS >= 0) {734- loop_timeoutNS = SDL_min(loop_timeoutNS, poll_intervalNS);735- } else {736- loop_timeoutNS = poll_intervalNS;737- }738- }739- SDL_SetAtomicPointer(&_this->wakeup_window, wakeup_window);740- status = _this->WaitEventTimeout(_this, loop_timeoutNS);741- SDL_SetAtomicPointer(&_this->wakeup_window, NULL);742- if (status == 0 && poll_intervalNS != SDL_MAX_SINT64 && loop_timeoutNS == poll_intervalNS) {743- // We may have woken up to poll. Try again744- continue;745- } else if (status <= 0) {746- // There is either an error or the timeout is elapsed: return747- return status;748- }749- /* An event was found and pumped into the SDL events queue. Continue the loop750- to let SDL_PeepEvents pick it up .*/751- }752- return 0;753-}754-755-static SDL_Window *SDL_find_active_window(SDL_VideoDevice *_this)756-{757- SDL_Window *window;758- for (window = _this->windows; window; window = window->next) {759- if (!window->is_destroying) {760- return window;761- }762- }763- return NULL;764-}765-766-#endif // !SDL_PLATFORM_ANDROID767-768bool SDL_WaitEvent(SDL_Event *event)769{770return SDL_WaitEventTimeoutNS(event, -1);771@@ -1662,24 +1545,6 @@ bool SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS)772Android_PumpEvents(delay);773}774#else775- SDL_VideoDevice *_this = SDL_GetVideoDevice();776- if (_this && _this->WaitEventTimeout && _this->SendWakeupEvent) {777- // Look if a shown window is available to send the wakeup event.778- SDL_Window *wakeup_window = SDL_find_active_window(_this);779- if (wakeup_window) {780- result = SDL_WaitEventTimeout_Device(_this, wakeup_window, event, start, timeoutNS);781- if (result > 0) {782- return true;783- } else if (result == 0) {784- return false;785- } else {786- /* There may be implementation-defined conditions where the backend cannot787- * reliably wait for the next event. If that happens, fall back to polling.788- */789- }790- }791- }792-793for (;;) {794SDL_PumpEventsInternal(true);795796@@ -1852,7 +1717,7 @@ void SDL_SetEventEnabled(Uint32 type, bool enabled)797/* turn off drag'n'drop support if we've disabled the events.798This might change some UI details at the OS level. */799if (type == SDL_EVENT_DROP_FILE || type == SDL_EVENT_DROP_TEXT) {800- SDL_ToggleDragAndDropSupport();801+ //SDL_ToggleDragAndDropSupport();802}803}804}805@@ -1944,14 +1809,14 @@ bool SDL_InitEvents(void)806return false;807}808809- SDL_InitQuit();810+ //SDL_InitQuit();811812return true;813}814815void SDL_QuitEvents(void)816{817- SDL_QuitQuit();818+ //SDL_QuitQuit();819SDL_StopEventLoop();820SDL_QuitMainThreadCallbacks();821SDL_RemoveHintCallback(SDL_HINT_POLL_SENTINEL, SDL_PollSentinelChanged, NULL);822diff --git a/thirdparty/sdl/events/SDL_events_c.h b/thirdparty/sdl/events/SDL_events_c.h823index e56ac475e5..f3a0744d1c 100644824--- a/thirdparty/sdl/events/SDL_events_c.h825+++ b/thirdparty/sdl/events/SDL_events_c.h826@@ -25,16 +25,9 @@827#include "SDL_internal.h"828829// Useful functions and variables from SDL_events.c830-#include "../video/SDL_sysvideo.h"831+//#include "../video/SDL_sysvideo.h"832833-#include "SDL_clipboardevents_c.h"834-#include "SDL_displayevents_c.h"835-#include "SDL_dropevents_c.h"836-#include "SDL_keyboard_c.h"837#include "SDL_mouse_c.h"838-#include "SDL_touch_c.h"839-#include "SDL_pen_c.h"840-#include "SDL_windowevents_c.h"841842// Start and stop the event processing loop843extern bool SDL_StartEventLoop(void);844diff --git a/thirdparty/sdl/include/SDL3/SDL.h b/thirdparty/sdl/include/SDL3/SDL.h845index ed1b32483a..f0671c95c3 100644846--- a/thirdparty/sdl/include/SDL3/SDL.h847+++ b/thirdparty/sdl/include/SDL3/SDL.h848@@ -47,7 +47,7 @@849#include <SDL3/SDL_events.h>850#include <SDL3/SDL_filesystem.h>851#include <SDL3/SDL_gamepad.h>852-#include <SDL3/SDL_gpu.h>853+//#include <SDL3/SDL_gpu.h>854#include <SDL3/SDL_guid.h>855#include <SDL3/SDL_haptic.h>856#include <SDL3/SDL_hidapi.h>857@@ -85,6 +85,6 @@858#include <SDL3/SDL_touch.h>859#include <SDL3/SDL_version.h>860#include <SDL3/SDL_video.h>861-#include <SDL3/SDL_oldnames.h>862+//#include <SDL3/SDL_oldnames.h>863864#endif /* SDL_h_ */865diff --git a/thirdparty/sdl/joystick/SDL_joystick.c b/thirdparty/sdl/joystick/SDL_joystick.c866index 921576854e..f36ca95baa 100644867--- a/thirdparty/sdl/joystick/SDL_joystick.c868+++ b/thirdparty/sdl/joystick/SDL_joystick.c869@@ -29,7 +29,7 @@870#include "SDL_steam_virtual_gamepad.h"871872#include "../events/SDL_events_c.h"873-#include "../video/SDL_sysvideo.h"874+//#include "../video/SDL_sysvideo.h"875#include "../sensor/SDL_sensor_c.h"876#include "hidapi/SDL_hidapijoystick_c.h"877878@@ -1011,7 +1011,8 @@ static void AttemptSensorFusion(SDL_Joystick *joystick, bool invert_sensors)879When a phone is being used as a gamepad, its orientation changes,880so adjust sensor axes to match.881*/882- if (SDL_GetNaturalDisplayOrientation(SDL_GetPrimaryDisplay()) == SDL_ORIENTATION_LANDSCAPE) {883+ //if (SDL_GetNaturalDisplayOrientation(SDL_GetPrimaryDisplay()) == SDL_ORIENTATION_LANDSCAPE) {884+ if (true) {885/* When a device in landscape orientation is laid flat, the axes change886orientation as follows:887-X to +X becomes -X to +X888@@ -2068,11 +2069,6 @@ static bool SDL_PrivateJoystickShouldIgnoreEvent(void)889if (SDL_joystick_allows_background_events) {890return false;891}892-893- if (SDL_HasWindows() && SDL_GetKeyboardFocus() == NULL) {894- // We have windows but we don't have focus, ignore the event.895- return true;896- }897return false;898}899900diff --git a/thirdparty/sdl/joystick/windows/SDL_dinputjoystick.c b/thirdparty/sdl/joystick/windows/SDL_dinputjoystick.c901index b00218d969..377992ed9e 100644902--- a/thirdparty/sdl/joystick/windows/SDL_dinputjoystick.c903+++ b/thirdparty/sdl/joystick/windows/SDL_dinputjoystick.c904@@ -40,11 +40,8 @@905#define CONVERT_MAGNITUDE(x) (((x)*10000) / 0x7FFF)906907// external variables referenced.908-#ifdef SDL_VIDEO_DRIVER_WINDOWS909extern HWND SDL_HelperWindow;910-#else911-static const HWND SDL_HelperWindow = NULL;912-#endif913+914915// local variables916static bool coinitialized = false;917918919