File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,15 @@ pg_init(PyObject *self, PyObject *_null)
217217 /* IMPPREFIX "_sdl2.controller", Is this required? Comment for now*/
218218 NULL };
219219
220+ #if SDL_VERSION_ATLEAST (3 , 0 , 0 )
221+ // In SDL3, specify that signal handlers should not be enabled.
222+ // By default, unlike SDL2, these signal handlers convert into QUIT
223+ // events. However, if QUIT events / events aren't being handled,
224+ // this leaves people unable to quit their script. Plus it's different
225+ // than SDL2 behavior.
226+ SDL_SetHint (SDL_HINT_NO_SIGNAL_HANDLERS , "1" );
227+ #endif
228+
220229 /*nice to initialize timer, so startup time will reflec pg_init() time*/
221230#if defined(WITH_THREAD ) && !defined(MS_WIN32 ) && defined(SDL_INIT_EVENTTHREAD )
222231 pg_sdl_was_init = PG_InitSubSystem (SDL_INIT_EVENTTHREAD | PG_INIT_TIMER |
You can’t perform that action at this time.
0 commit comments