diff --git a/kivy/core/window/_window_sdl2.pyx b/kivy/core/window/_window_sdl2.pyx index 5ea9606a7..25832b77c 100644 --- a/kivy/core/window/_window_sdl2.pyx +++ b/kivy/core/window/_window_sdl2.pyx @@ -238,8 +238,11 @@ cdef class _WindowSDL2Storage: def poll(self): cdef SDL_Event event + cdef int rv - if SDL_PollEvent(&event) == 0: + with nogil: + rv = SDL_PollEvent(&event) + if rv == 0: return False action = None diff --git a/kivy/lib/sdl2.pxi b/kivy/lib/sdl2.pxi index fe23b1989..b322f7d38 100644 --- a/kivy/lib/sdl2.pxi +++ b/kivy/lib/sdl2.pxi @@ -467,7 +467,7 @@ cdef extern from "SDL.h": cdef Uint32 SDL_GetTicks() cdef void SDL_Delay(Uint32 ms) nogil cdef Uint8 SDL_EventState(Uint32 type, int state) - cdef int SDL_PollEvent(SDL_Event * event) + cdef int SDL_PollEvent(SDL_Event * event) nogil cdef void SDL_SetEventFilter(SDL_EventFilter *filter, void* userdata) cdef SDL_RWops * SDL_RWFromFile(char *file, char *mode) cdef SDL_RWops * SDL_RWFromMem(void *mem, int size)