diff options
Diffstat (limited to 'Source/3rdParty/SDL2/src/events/SDL_events.c')
-rw-r--r-- | Source/3rdParty/SDL2/src/events/SDL_events.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/3rdParty/SDL2/src/events/SDL_events.c b/Source/3rdParty/SDL2/src/events/SDL_events.c index f2e5b62..25e8ac4 100644 --- a/Source/3rdParty/SDL2/src/events/SDL_events.c +++ b/Source/3rdParty/SDL2/src/events/SDL_events.c @@ -417,6 +417,10 @@ SDL_StartEventLoop(void) SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE); SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE); +#if 0 /* Leave these events enabled so apps can respond to items being dragged onto them at startup */ + SDL_EventState(SDL_DROPFILE, SDL_DISABLE); + SDL_EventState(SDL_DROPTEXT, SDL_DISABLE); +#endif SDL_AtomicSet(&SDL_EventQ.active, 1); @@ -604,6 +608,10 @@ SDL_FlushEvent(Uint32 type) void SDL_FlushEvents(Uint32 minType, Uint32 maxType) { + /* !!! FIXME: we need to manually SDL_free() the strings in TEXTINPUT and + drag'n'drop events if we're flushing them without passing them to the + app, but I don't know if this is the right place to do that. */ + /* Don't look after we've quit */ if (!SDL_AtomicGet(&SDL_EventQ.active)) { return; @@ -651,6 +659,13 @@ SDL_PumpEvents(void) } #endif +#if !SDL_SENSOR_DISABLED + /* Check for sensor state change */ + if (!SDL_disabled_events[SDL_SENSORUPDATE >> 8]) { + SDL_SensorUpdate(); + } +#endif + SDL_SendPendingQuit(); /* in case we had a signal handler fire, etc. */ } @@ -863,6 +878,8 @@ SDL_FilterEvents(SDL_EventFilter filter, void *userdata) Uint8 SDL_EventState(Uint32 type, int state) { + const SDL_bool isdnd = ((state == SDL_DISABLE) || (state == SDL_ENABLE)) && + ((type == SDL_DROPFILE) || (type == SDL_DROPTEXT)); Uint8 current_state; Uint8 hi = ((type >> 8) & 0xff); Uint8 lo = (type & 0xff); @@ -898,6 +915,12 @@ SDL_EventState(Uint32 type, int state) } } + /* turn off drag'n'drop support if we've disabled the events. + This might change some UI details at the OS level. */ + if (isdnd) { + SDL_ToggleDragAndDropSupport(); + } + return current_state; } |