mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-03 20:44:42 +00:00
Don't pass the sentinel event to event callbacks
This is just for internal use and we don't need to incur the overhead of calling callback and watchers for this event.
This commit is contained in:
@@ -1248,7 +1248,8 @@ int SDL_PushEvent(SDL_Event *event)
|
||||
event->common.timestamp = SDL_GetTicksNS();
|
||||
}
|
||||
|
||||
if (SDL_EventOK.callback || SDL_event_watchers_count > 0) {
|
||||
if ((SDL_EventOK.callback || SDL_event_watchers_count > 0) &&
|
||||
(event->common.type != SDL_EVENT_POLL_SENTINEL)) {
|
||||
SDL_LockMutex(SDL_event_watchers_lock);
|
||||
{
|
||||
if (SDL_EventOK.callback && !SDL_EventOK.callback(SDL_EventOK.userdata, event)) {
|
||||
|
||||
Reference in New Issue
Block a user