Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/sdl/patches/0001-remove-unnecessary-subsystems.patch
22071 views
1
diff --git a/thirdparty/sdl/SDL.c b/thirdparty/sdl/SDL.c
2
index 46a74aafdb..3dad7e29ba 100644
3
--- a/thirdparty/sdl/SDL.c
4
+++ b/thirdparty/sdl/SDL.c
5
@@ -40,23 +40,14 @@
6
#include "SDL_hints_c.h"
7
#include "SDL_log_c.h"
8
#include "SDL_properties_c.h"
9
-#include "audio/SDL_sysaudio.h"
10
-#include "camera/SDL_camera_c.h"
11
-#include "cpuinfo/SDL_cpuinfo_c.h"
12
+//#include "audio/SDL_sysaudio.h"
13
#include "events/SDL_events_c.h"
14
#include "haptic/SDL_haptic_c.h"
15
#include "joystick/SDL_gamepad_c.h"
16
#include "joystick/SDL_joystick_c.h"
17
-#include "render/SDL_sysrender.h"
18
#include "sensor/SDL_sensor_c.h"
19
#include "stdlib/SDL_getenv_c.h"
20
#include "thread/SDL_thread_c.h"
21
-#include "tray/SDL_tray_utils.h"
22
-#include "video/SDL_pixels_c.h"
23
-#include "video/SDL_surface_c.h"
24
-#include "video/SDL_video_c.h"
25
-#include "filesystem/SDL_filesystem_c.h"
26
-#include "io/SDL_asyncio_c.h"
27
#ifdef SDL_PLATFORM_ANDROID
28
#include "core/android/SDL_android.h"
29
#endif
30
@@ -278,7 +269,7 @@ void SDL_InitMainThread(void)
31
SDL_InitTLSData();
32
SDL_InitEnvironment();
33
SDL_InitTicks();
34
- SDL_InitFilesystem();
35
+ //SDL_InitFilesystem();
36
37
if (!done_info) {
38
const char *value;
39
@@ -297,7 +288,7 @@ void SDL_InitMainThread(void)
40
41
static void SDL_QuitMainThread(void)
42
{
43
- SDL_QuitFilesystem();
44
+ //SDL_QuitFilesystem();
45
SDL_QuitTicks();
46
SDL_QuitEnvironment();
47
SDL_QuitTLSData();
48
@@ -657,21 +648,21 @@ void SDL_Quit(void)
49
SDL_HelperWindowDestroy();
50
#endif
51
SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
52
- SDL_CleanupTrays();
53
+ //SDL_CleanupTrays();
54
55
#ifdef SDL_USE_LIBDBUS
56
SDL_DBus_Quit();
57
#endif
58
59
SDL_QuitTimers();
60
- SDL_QuitAsyncIO();
61
+ //SDL_QuitAsyncIO();
62
63
SDL_SetObjectsInvalid();
64
SDL_AssertionsQuit();
65
66
- SDL_QuitPixelFormatDetails();
67
+ //SDL_QuitPixelFormatDetails();
68
69
- SDL_QuitCPUInfo();
70
+ //SDL_QuitCPUInfo();
71
72
/* Now that every subsystem has been quit, we reset the subsystem refcount
73
* and the list of initialized subsystems.
74
diff --git a/thirdparty/sdl/SDL_assert.c b/thirdparty/sdl/SDL_assert.c
75
index 2440d04b1e..af904039a4 100644
76
--- a/thirdparty/sdl/SDL_assert.c
77
+++ b/thirdparty/sdl/SDL_assert.c
78
@@ -25,7 +25,7 @@
79
#endif
80
81
#include "SDL_assert_c.h"
82
-#include "video/SDL_sysvideo.h"
83
+//#include "video/SDL_sysvideo.h"
84
85
#if defined(SDL_PLATFORM_WINDOWS)
86
#ifndef WS_OVERLAPPEDWINDOW
87
@@ -209,18 +209,6 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
88
}
89
}
90
91
- // Leave fullscreen mode, if possible (scary!)
92
- window = SDL_GetToplevelForKeyboardFocus();
93
- if (window) {
94
- if (window->fullscreen_exclusive) {
95
- SDL_MinimizeWindow(window);
96
- } else {
97
- // !!! FIXME: ungrab the input if we're not fullscreen?
98
- // No need to mess with the window
99
- window = NULL;
100
- }
101
- }
102
-
103
// Show a messagebox if we can, otherwise fall back to stdio
104
SDL_zero(messagebox);
105
messagebox.flags = SDL_MESSAGEBOX_WARNING;
106
@@ -230,7 +218,8 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
107
messagebox.numbuttons = SDL_arraysize(buttons);
108
messagebox.buttons = buttons;
109
110
- if (SDL_ShowMessageBox(&messagebox, &selected)) {
111
+ //if (SDL_ShowMessageBox(&messagebox, &selected)) {
112
+ if (false) {
113
if (selected == -1) {
114
state = SDL_ASSERTION_IGNORE;
115
} else {
116
@@ -311,13 +300,13 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
117
}
118
}
119
#else
120
- SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, "Assertion Failed", message, window);
121
+ //SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, "Assertion Failed", message, window);
122
#endif // HAVE_STDIO_H
123
}
124
125
// Re-enter fullscreen mode
126
if (window) {
127
- SDL_RestoreWindow(window);
128
+ //SDL_RestoreWindow(window);
129
}
130
131
if (message != stack_buf) {
132
diff --git a/thirdparty/sdl/SDL_internal.h b/thirdparty/sdl/SDL_internal.h
133
index 8fcd96a7fa..20ec0fcb91 100644
134
--- a/thirdparty/sdl/SDL_internal.h
135
+++ b/thirdparty/sdl/SDL_internal.h
136
@@ -62,7 +62,7 @@
137
138
#include "SDL_build_config.h"
139
140
-#include "dynapi/SDL_dynapi.h"
141
+//#include "dynapi/SDL_dynapi.h"
142
143
#if SDL_DYNAMIC_API
144
#include "dynapi/SDL_dynapi_overrides.h"
145
diff --git a/thirdparty/sdl/SDL_properties.c b/thirdparty/sdl/SDL_properties.c
146
index 166ea0f918..42d4845458 100644
147
--- a/thirdparty/sdl/SDL_properties.c
148
+++ b/thirdparty/sdl/SDL_properties.c
149
@@ -409,7 +409,7 @@ static void SDLCALL CleanupSurface(void *userdata, void *value)
150
{
151
SDL_Surface *surface = (SDL_Surface *)value;
152
153
- SDL_DestroySurface(surface);
154
+ //SDL_DestroySurface(surface);
155
}
156
157
bool SDL_SetSurfaceProperty(SDL_PropertiesID props, const char *name, SDL_Surface *surface)
158
diff --git a/thirdparty/sdl/core/linux/SDL_evdev.c b/thirdparty/sdl/core/linux/SDL_evdev.c
159
index 5746e2ef98..04e3e9d6b6 100644
160
--- a/thirdparty/sdl/core/linux/SDL_evdev.c
161
+++ b/thirdparty/sdl/core/linux/SDL_evdev.c
162
@@ -39,7 +39,6 @@
163
#include <linux/input.h>
164
165
#include "../../events/SDL_events_c.h"
166
-#include "../../events/SDL_scancode_tables_c.h"
167
#include "../../core/linux/SDL_evdev_capabilities.h"
168
#include "../../core/linux/SDL_udev.h"
169
170
@@ -221,7 +220,7 @@ bool SDL_EVDEV_Init(void)
171
SDL_EVDEV_UpdateKeyboardMute();
172
}
173
174
- SDL_GetMouse()->SetRelativeMouseMode = SDL_EVDEV_SetRelativeMouseMode;
175
+ //SDL_GetMouse()->SetRelativeMouseMode = SDL_EVDEV_SetRelativeMouseMode;
176
177
_this->ref_count += 1;
178
179
@@ -328,7 +327,7 @@ void SDL_EVDEV_Poll(void)
180
181
SDL_EVDEV_kbd_update(_this->kbd);
182
183
- mouse = SDL_GetMouse();
184
+ mouse = NULL; //SDL_GetMouse();
185
186
for (item = _this->first; item; item = item->next) {
187
while ((len = read(item->fd, events, sizeof(events))) > 0) {
188
@@ -345,10 +344,11 @@ void SDL_EVDEV_Poll(void)
189
190
switch (event->type) {
191
case EV_KEY:
192
+ break;
193
if (event->code >= BTN_MOUSE && event->code < BTN_MOUSE + SDL_arraysize(EVDEV_MouseButtons)) {
194
Uint64 timestamp = SDL_EVDEV_GetEventTimestamp(event);
195
mouse_button = event->code - BTN_MOUSE;
196
- SDL_SendMouseButton(timestamp, mouse->focus, (SDL_MouseID)item->fd, EVDEV_MouseButtons[mouse_button], (event->value != 0));
197
+ //SDL_SendMouseButton(timestamp, mouse->focus, (SDL_MouseID)item->fd, EVDEV_MouseButtons[mouse_button], (event->value != 0));
198
break;
199
}
200
201
@@ -371,11 +371,11 @@ void SDL_EVDEV_Poll(void)
202
{
203
Uint64 timestamp = SDL_EVDEV_GetEventTimestamp(event);
204
scancode = SDL_EVDEV_translate_keycode(event->code);
205
- if (event->value == 0) {
206
- SDL_SendKeyboardKey(timestamp, (SDL_KeyboardID)item->fd, event->code, scancode, false);
207
- } else if (event->value == 1 || event->value == 2 /* key repeated */) {
208
- SDL_SendKeyboardKey(timestamp, (SDL_KeyboardID)item->fd, event->code, scancode, true);
209
- }
210
+ // if (event->value == 0) {
211
+ // SDL_SendKeyboardKey(timestamp, (SDL_KeyboardID)item->fd, event->code, scancode, false);
212
+ // } else if (event->value == 1 || event->value == 2 /* key repeated */) {
213
+ // SDL_SendKeyboardKey(timestamp, (SDL_KeyboardID)item->fd, event->code, scancode, true);
214
+ // }
215
SDL_EVDEV_kbd_keycode(_this->kbd, event->code, event->value);
216
}
217
break;
218
@@ -490,36 +490,30 @@ void SDL_EVDEV_Poll(void)
219
if (item->relative_mouse) {
220
if (item->mouse_x != 0 || item->mouse_y != 0) {
221
Uint64 timestamp = SDL_EVDEV_GetEventTimestamp(event);
222
- SDL_SendMouseMotion(timestamp, mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse, (float)item->mouse_x, (float)item->mouse_y);
223
+ //SDL_SendMouseMotion(timestamp, mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse, (float)item->mouse_x, (float)item->mouse_y);
224
item->mouse_x = item->mouse_y = 0;
225
}
226
} else if (item->range_x > 0 && item->range_y > 0) {
227
int screen_w = 0, screen_h = 0;
228
const SDL_DisplayMode *mode = NULL;
229
230
- if (mouse->focus) {
231
- mode = SDL_GetCurrentDisplayMode(SDL_GetDisplayForWindow(mouse->focus));
232
- }
233
- if (!mode) {
234
- mode = SDL_GetCurrentDisplayMode(SDL_GetPrimaryDisplay());
235
- }
236
if (mode) {
237
screen_w = mode->w;
238
screen_h = mode->h;
239
}
240
- SDL_SendMouseMotion(SDL_EVDEV_GetEventTimestamp(event), mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse,
241
- (float)(item->mouse_x - item->min_x) * screen_w / item->range_x,
242
- (float)(item->mouse_y - item->min_y) * screen_h / item->range_y);
243
+ //SDL_SendMouseMotion(SDL_EVDEV_GetEventTimestamp(event), mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse,
244
+ // (float)(item->mouse_x - item->min_x) * screen_w / item->range_x,
245
+ // (float)(item->mouse_y - item->min_y) * screen_h / item->range_y);
246
}
247
248
if (item->mouse_wheel != 0 || item->mouse_hwheel != 0) {
249
Uint64 timestamp = SDL_EVDEV_GetEventTimestamp(event);
250
const float denom = (item->high_res_hwheel ? 120.0f : 1.0f);
251
- SDL_SendMouseWheel(timestamp,
252
- mouse->focus, (SDL_MouseID)item->fd,
253
- item->mouse_hwheel / denom,
254
- item->mouse_wheel / denom,
255
- SDL_MOUSEWHEEL_NORMAL);
256
+ //SDL_SendMouseWheel(timestamp,
257
+ // mouse->focus, (SDL_MouseID)item->fd,
258
+ // item->mouse_hwheel / denom,
259
+ // item->mouse_wheel / denom,
260
+ // SDL_MOUSEWHEEL_NORMAL);
261
item->mouse_wheel = item->mouse_hwheel = 0;
262
}
263
264
@@ -546,16 +540,16 @@ void SDL_EVDEV_Poll(void)
265
* be window-relative in that case. */
266
switch (item->touchscreen_data->slots[j].delta) {
267
case EVDEV_TOUCH_SLOTDELTA_DOWN:
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);
269
+ //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);
270
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
271
break;
272
case EVDEV_TOUCH_SLOTDELTA_UP:
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);
274
+ //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);
275
item->touchscreen_data->slots[j].tracking_id = 0;
276
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
277
break;
278
case EVDEV_TOUCH_SLOTDELTA_MOVE:
279
- SDL_SendTouchMotion(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, norm_x, norm_y, norm_pressure);
280
+ //SDL_SendTouchMotion(SDL_EVDEV_GetEventTimestamp(event), item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, norm_x, norm_y, norm_pressure);
281
item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
282
break;
283
default:
284
@@ -585,7 +579,7 @@ void SDL_EVDEV_Poll(void)
285
286
static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode)
287
{
288
- SDL_Scancode scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_LINUX, keycode);
289
+ //SDL_Scancode scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_LINUX, keycode);
290
291
#ifdef DEBUG_SCANCODES
292
if (scancode == SDL_SCANCODE_UNKNOWN) {
293
@@ -602,7 +596,7 @@ static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode)
294
}
295
#endif // DEBUG_SCANCODES
296
297
- return scancode;
298
+ return 0; //scancode;
299
}
300
301
static bool SDL_EVDEV_init_keyboard(SDL_evdevlist_item *item, int udev_class)
302
@@ -612,14 +606,14 @@ static bool SDL_EVDEV_init_keyboard(SDL_evdevlist_item *item, int udev_class)
303
name[0] = '\0';
304
ioctl(item->fd, EVIOCGNAME(sizeof(name)), name);
305
306
- SDL_AddKeyboard((SDL_KeyboardID)item->fd, name, true);
307
+ //SDL_AddKeyboard((SDL_KeyboardID)item->fd, name, true);
308
309
return true;
310
}
311
312
static void SDL_EVDEV_destroy_keyboard(SDL_evdevlist_item *item)
313
{
314
- SDL_RemoveKeyboard((SDL_KeyboardID)item->fd, true);
315
+ //SDL_RemoveKeyboard((SDL_KeyboardID)item->fd, true);
316
}
317
318
static bool SDL_EVDEV_init_mouse(SDL_evdevlist_item *item, int udev_class)
319
@@ -631,7 +625,7 @@ static bool SDL_EVDEV_init_mouse(SDL_evdevlist_item *item, int udev_class)
320
name[0] = '\0';
321
ioctl(item->fd, EVIOCGNAME(sizeof(name)), name);
322
323
- SDL_AddMouse((SDL_MouseID)item->fd, name, true);
324
+ //SDL_AddMouse((SDL_MouseID)item->fd, name, true);
325
326
ret = ioctl(item->fd, EVIOCGABS(ABS_X), &abs_info);
327
if (ret < 0) {
328
@@ -656,7 +650,7 @@ static bool SDL_EVDEV_init_mouse(SDL_evdevlist_item *item, int udev_class)
329
330
static void SDL_EVDEV_destroy_mouse(SDL_evdevlist_item *item)
331
{
332
- SDL_RemoveMouse((SDL_MouseID)item->fd, true);
333
+ //SDL_RemoveMouse((SDL_MouseID)item->fd, true);
334
}
335
336
static bool SDL_EVDEV_init_touchscreen(SDL_evdevlist_item *item, int udev_class)
337
@@ -743,9 +737,10 @@ static bool SDL_EVDEV_init_touchscreen(SDL_evdevlist_item *item, int udev_class)
338
return false;
339
}
340
341
- ret = SDL_AddTouch(item->fd, // I guess our fd is unique enough
342
- (udev_class & SDL_UDEV_DEVICE_TOUCHPAD) ? SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE : SDL_TOUCH_DEVICE_DIRECT,
343
- item->touchscreen_data->name);
344
+ //ret = SDL_AddTouch(item->fd, // I guess our fd is unique enough
345
+ // (udev_class & SDL_UDEV_DEVICE_TOUCHPAD) ? SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE : SDL_TOUCH_DEVICE_DIRECT,
346
+ // item->touchscreen_data->name);
347
+ ret = -1;
348
if (ret < 0) {
349
SDL_free(item->touchscreen_data->slots);
350
SDL_free(item->touchscreen_data->name);
351
@@ -762,7 +757,7 @@ static void SDL_EVDEV_destroy_touchscreen(SDL_evdevlist_item *item)
352
return;
353
}
354
355
- SDL_DelTouch(item->fd);
356
+ //SDL_DelTouch(item->fd);
357
SDL_free(item->touchscreen_data->slots);
358
SDL_free(item->touchscreen_data->name);
359
SDL_free(item->touchscreen_data);
360
diff --git a/thirdparty/sdl/events/SDL_events.c b/thirdparty/sdl/events/SDL_events.c
361
index 81220a1787..7ca683e0eb 100644
362
--- a/thirdparty/sdl/events/SDL_events.c
363
+++ b/thirdparty/sdl/events/SDL_events.c
364
@@ -24,10 +24,7 @@
365
366
#include "SDL_events_c.h"
367
#include "SDL_eventwatch_c.h"
368
-#include "SDL_windowevents_c.h"
369
#include "../SDL_hints_c.h"
370
-#include "../audio/SDL_audio_c.h"
371
-#include "../camera/SDL_camera_c.h"
372
#include "../timer/SDL_timer_c.h"
373
#ifndef SDL_JOYSTICK_DISABLED
374
#include "../joystick/SDL_joystick_c.h"
375
@@ -35,7 +32,7 @@
376
#ifndef SDL_SENSOR_DISABLED
377
#include "../sensor/SDL_sensor_c.h"
378
#endif
379
-#include "../video/SDL_sysvideo.h"
380
+//#include "../video/SDL_sysvideo.h"
381
382
#ifdef SDL_PLATFORM_ANDROID
383
#include "../core/android/SDL_android.h"
384
@@ -930,7 +927,7 @@ void SDL_StopEventLoop(void)
385
}
386
387
SDL_QuitEventWatchList(&SDL_event_watchers);
388
- SDL_QuitWindowEventWatch();
389
+ //SDL_QuitWindowEventWatch();
390
391
SDL_Mutex *lock = NULL;
392
if (SDL_EventQ.lock) {
393
@@ -970,7 +967,7 @@ bool SDL_StartEventLoop(void)
394
}
395
#endif // !SDL_THREADS_DISABLED
396
397
- SDL_InitWindowEventWatch();
398
+ //SDL_InitWindowEventWatch();
399
400
SDL_EventQ.active = true;
401
402
@@ -1071,17 +1068,6 @@ static void SDL_SendWakeupEvent(void)
403
{
404
#ifdef SDL_PLATFORM_ANDROID
405
Android_SendLifecycleEvent(SDL_ANDROID_LIFECYCLE_WAKE);
406
-#else
407
- SDL_VideoDevice *_this = SDL_GetVideoDevice();
408
- if (_this == NULL || !_this->SendWakeupEvent) {
409
- return;
410
- }
411
-
412
- // We only want to do this once while waiting for an event, so set it to NULL atomically here
413
- SDL_Window *wakeup_window = (SDL_Window *)SDL_SetAtomicPointer(&_this->wakeup_window, NULL);
414
- if (wakeup_window) {
415
- _this->SendWakeupEvent(_this, wakeup_window);
416
- }
417
#endif
418
}
419
420
@@ -1421,9 +1407,9 @@ void SDL_PumpEventMaintenance(void)
421
}
422
#endif
423
424
- SDL_UpdateTrays();
425
+ //SDL_UpdateTrays();
426
427
- SDL_SendPendingSignalEvents(); // in case we had a signal handler fire, etc.
428
+ //SDL_SendPendingSignalEvents(); // in case we had a signal handler fire, etc.
429
}
430
431
// Run the system dependent event loops
432
@@ -1433,7 +1419,7 @@ static void SDL_PumpEventsInternal(bool push_sentinel)
433
SDL_FreeTemporaryMemory();
434
435
// Release any keys held down from last frame
436
- SDL_ReleaseAutoReleaseKeys();
437
+ //SDL_ReleaseAutoReleaseKeys();
438
439
// Run any pending main thread callbacks
440
SDL_RunMainThreadCallbacks();
441
@@ -1441,12 +1427,6 @@ static void SDL_PumpEventsInternal(bool push_sentinel)
442
#ifdef SDL_PLATFORM_ANDROID
443
// Android event processing is independent of the video subsystem
444
Android_PumpEvents(0);
445
-#else
446
- // Get events from the video subsystem
447
- SDL_VideoDevice *_this = SDL_GetVideoDevice();
448
- if (_this) {
449
- _this->PumpEvents(_this);
450
- }
451
#endif
452
453
SDL_PumpEventMaintenance();
454
@@ -1477,103 +1457,6 @@ bool SDL_PollEvent(SDL_Event *event)
455
return SDL_WaitEventTimeoutNS(event, 0);
456
}
457
458
-#ifndef SDL_PLATFORM_ANDROID
459
-
460
-static Sint64 SDL_events_get_polling_interval(void)
461
-{
462
- Sint64 poll_intervalNS = SDL_MAX_SINT64;
463
-
464
-#ifndef SDL_JOYSTICK_DISABLED
465
- if (SDL_WasInit(SDL_INIT_JOYSTICK) && SDL_update_joysticks) {
466
- if (SDL_JoysticksOpened()) {
467
- // If we have joysticks open, we need to poll rapidly for events
468
- poll_intervalNS = SDL_min(poll_intervalNS, EVENT_POLL_INTERVAL_NS);
469
- } else {
470
- // If not, just poll every few seconds to enumerate new joysticks
471
- poll_intervalNS = SDL_min(poll_intervalNS, ENUMERATION_POLL_INTERVAL_NS);
472
- }
473
- }
474
-#endif
475
-
476
-#ifndef SDL_SENSOR_DISABLED
477
- if (SDL_WasInit(SDL_INIT_SENSOR) && SDL_update_sensors && SDL_SensorsOpened()) {
478
- // If we have sensors open, we need to poll rapidly for events
479
- poll_intervalNS = SDL_min(poll_intervalNS, EVENT_POLL_INTERVAL_NS);
480
- }
481
-#endif
482
-
483
- return poll_intervalNS;
484
-}
485
-
486
-static int SDL_WaitEventTimeout_Device(SDL_VideoDevice *_this, SDL_Window *wakeup_window, SDL_Event *event, Uint64 start, Sint64 timeoutNS)
487
-{
488
- Sint64 loop_timeoutNS = timeoutNS;
489
- Sint64 poll_intervalNS = SDL_events_get_polling_interval();
490
-
491
- for (;;) {
492
- int status;
493
- /* Pump events on entry and each time we wake to ensure:
494
- a) All pending events are batch processed after waking up from a wait
495
- b) Waiting can be completely skipped if events are already available to be pumped
496
- c) Periodic processing that takes place in some platform PumpEvents() functions happens
497
- d) Signals received in WaitEventTimeout() are turned into SDL events
498
- */
499
- SDL_PumpEventsInternal(true);
500
-
501
- status = SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_EVENT_FIRST, SDL_EVENT_LAST);
502
- if (status < 0) {
503
- // Got an error: return
504
- break;
505
- }
506
- if (status > 0) {
507
- // There is an event, we can return.
508
- return 1;
509
- }
510
- // No events found in the queue, call WaitEventTimeout to wait for an event.
511
- if (timeoutNS > 0) {
512
- Sint64 elapsed = SDL_GetTicksNS() - start;
513
- if (elapsed >= timeoutNS) {
514
- return 0;
515
- }
516
- loop_timeoutNS = (timeoutNS - elapsed);
517
- }
518
- // Adjust the timeout for any polling requirements we currently have.
519
- if (poll_intervalNS != SDL_MAX_SINT64) {
520
- if (loop_timeoutNS >= 0) {
521
- loop_timeoutNS = SDL_min(loop_timeoutNS, poll_intervalNS);
522
- } else {
523
- loop_timeoutNS = poll_intervalNS;
524
- }
525
- }
526
- SDL_SetAtomicPointer(&_this->wakeup_window, wakeup_window);
527
- status = _this->WaitEventTimeout(_this, loop_timeoutNS);
528
- SDL_SetAtomicPointer(&_this->wakeup_window, NULL);
529
- if (status == 0 && poll_intervalNS != SDL_MAX_SINT64 && loop_timeoutNS == poll_intervalNS) {
530
- // We may have woken up to poll. Try again
531
- continue;
532
- } else if (status <= 0) {
533
- // There is either an error or the timeout is elapsed: return
534
- return status;
535
- }
536
- /* An event was found and pumped into the SDL events queue. Continue the loop
537
- to let SDL_PeepEvents pick it up .*/
538
- }
539
- return 0;
540
-}
541
-
542
-static SDL_Window *SDL_find_active_window(SDL_VideoDevice *_this)
543
-{
544
- SDL_Window *window;
545
- for (window = _this->windows; window; window = window->next) {
546
- if (!window->is_destroying) {
547
- return window;
548
- }
549
- }
550
- return NULL;
551
-}
552
-
553
-#endif // !SDL_PLATFORM_ANDROID
554
-
555
bool SDL_WaitEvent(SDL_Event *event)
556
{
557
return SDL_WaitEventTimeoutNS(event, -1);
558
@@ -1665,24 +1548,6 @@ bool SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS)
559
Android_PumpEvents(delay);
560
}
561
#else
562
- SDL_VideoDevice *_this = SDL_GetVideoDevice();
563
- if (_this && _this->WaitEventTimeout && _this->SendWakeupEvent) {
564
- // Look if a shown window is available to send the wakeup event.
565
- SDL_Window *wakeup_window = SDL_find_active_window(_this);
566
- if (wakeup_window) {
567
- result = SDL_WaitEventTimeout_Device(_this, wakeup_window, event, start, timeoutNS);
568
- if (result > 0) {
569
- return true;
570
- } else if (result == 0) {
571
- return false;
572
- } else {
573
- /* There may be implementation-defined conditions where the backend cannot
574
- * reliably wait for the next event. If that happens, fall back to polling.
575
- */
576
- }
577
- }
578
- }
579
-
580
for (;;) {
581
SDL_PumpEventsInternal(true);
582
583
@@ -1855,7 +1720,7 @@ void SDL_SetEventEnabled(Uint32 type, bool enabled)
584
/* turn off drag'n'drop support if we've disabled the events.
585
This might change some UI details at the OS level. */
586
if (type == SDL_EVENT_DROP_FILE || type == SDL_EVENT_DROP_TEXT) {
587
- SDL_ToggleDragAndDropSupport();
588
+ //SDL_ToggleDragAndDropSupport();
589
}
590
}
591
}
592
@@ -1947,14 +1812,14 @@ bool SDL_InitEvents(void)
593
return false;
594
}
595
596
- SDL_InitQuit();
597
+ //SDL_InitQuit();
598
599
return true;
600
}
601
602
void SDL_QuitEvents(void)
603
{
604
- SDL_QuitQuit();
605
+ //SDL_QuitQuit();
606
SDL_StopEventLoop();
607
SDL_QuitMainThreadCallbacks();
608
SDL_RemoveHintCallback(SDL_HINT_POLL_SENTINEL, SDL_PollSentinelChanged, NULL);
609
diff --git a/thirdparty/sdl/events/SDL_events_c.h b/thirdparty/sdl/events/SDL_events_c.h
610
index e56ac475e5..f3a0744d1c 100644
611
--- a/thirdparty/sdl/events/SDL_events_c.h
612
+++ b/thirdparty/sdl/events/SDL_events_c.h
613
@@ -25,16 +25,9 @@
614
#include "SDL_internal.h"
615
616
// Useful functions and variables from SDL_events.c
617
-#include "../video/SDL_sysvideo.h"
618
+//#include "../video/SDL_sysvideo.h"
619
620
-#include "SDL_clipboardevents_c.h"
621
-#include "SDL_displayevents_c.h"
622
-#include "SDL_dropevents_c.h"
623
-#include "SDL_keyboard_c.h"
624
#include "SDL_mouse_c.h"
625
-#include "SDL_touch_c.h"
626
-#include "SDL_pen_c.h"
627
-#include "SDL_windowevents_c.h"
628
629
// Start and stop the event processing loop
630
extern bool SDL_StartEventLoop(void);
631
diff --git a/thirdparty/sdl/include/SDL3/SDL.h b/thirdparty/sdl/include/SDL3/SDL.h
632
index 7ec527b6d0..c99997044b 100644
633
--- a/thirdparty/sdl/include/SDL3/SDL.h
634
+++ b/thirdparty/sdl/include/SDL3/SDL.h
635
@@ -47,7 +47,7 @@
636
#include <SDL3/SDL_events.h>
637
#include <SDL3/SDL_filesystem.h>
638
#include <SDL3/SDL_gamepad.h>
639
-#include <SDL3/SDL_gpu.h>
640
+//#include <SDL3/SDL_gpu.h>
641
#include <SDL3/SDL_guid.h>
642
#include <SDL3/SDL_haptic.h>
643
#include <SDL3/SDL_hidapi.h>
644
@@ -85,6 +85,6 @@
645
#include <SDL3/SDL_touch.h>
646
#include <SDL3/SDL_version.h>
647
#include <SDL3/SDL_video.h>
648
-#include <SDL3/SDL_oldnames.h>
649
+//#include <SDL3/SDL_oldnames.h>
650
651
#endif /* SDL_h_ */
652
diff --git a/thirdparty/sdl/joystick/SDL_joystick.c b/thirdparty/sdl/joystick/SDL_joystick.c
653
index 5ce36de867..090dc07303 100644
654
--- a/thirdparty/sdl/joystick/SDL_joystick.c
655
+++ b/thirdparty/sdl/joystick/SDL_joystick.c
656
@@ -29,7 +29,7 @@
657
#include "SDL_steam_virtual_gamepad.h"
658
659
#include "../events/SDL_events_c.h"
660
-#include "../video/SDL_sysvideo.h"
661
+//#include "../video/SDL_sysvideo.h"
662
#include "../sensor/SDL_sensor_c.h"
663
#include "hidapi/SDL_hidapijoystick_c.h"
664
665
@@ -1014,7 +1014,8 @@ static void AttemptSensorFusion(SDL_Joystick *joystick, bool invert_sensors)
666
When a phone is being used as a gamepad, its orientation changes,
667
so adjust sensor axes to match.
668
*/
669
- if (SDL_GetNaturalDisplayOrientation(SDL_GetPrimaryDisplay()) == SDL_ORIENTATION_LANDSCAPE) {
670
+ //if (SDL_GetNaturalDisplayOrientation(SDL_GetPrimaryDisplay()) == SDL_ORIENTATION_LANDSCAPE) {
671
+ if (true) {
672
/* When a device in landscape orientation is laid flat, the axes change
673
orientation as follows:
674
-X to +X becomes -X to +X
675
@@ -2071,11 +2072,6 @@ static bool SDL_PrivateJoystickShouldIgnoreEvent(void)
676
if (SDL_joystick_allows_background_events) {
677
return false;
678
}
679
-
680
- if (SDL_HasWindows() && SDL_GetKeyboardFocus() == NULL) {
681
- // We have windows but we don't have focus, ignore the event.
682
- return true;
683
- }
684
return false;
685
}
686
687
688