mirror of https://github.com/libsdl-org/SDL.git
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:
parent
a03829d636
commit
63979f04c8
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue