From 35a38c1090172babf6637cf31a7c91e422bcb5b6 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 28 Apr 2024 15:41:31 +0200 Subject: [PATCH] fix --- app/src/screen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/screen.c b/app/src/screen.c index cda56246..9ee61383 100644 --- a/app/src/screen.c +++ b/app/src/screen.c @@ -272,6 +272,8 @@ sc_screen_render(struct sc_screen *screen, bool update_content_rect) { static int event_watcher(void *data, SDL_Event *event) { struct sc_screen *screen = data; + assert(screen->video); + if (event->type == SDL_WINDOWEVENT && event->window.event == SDL_WINDOWEVENT_RESIZED) { // In practice, it seems to always be called from the same thread in @@ -477,7 +479,9 @@ sc_screen_init(struct sc_screen *screen, sc_input_manager_init(&screen->im, &im_params); #ifdef CONTINUOUS_RESIZING_WORKAROUND - SDL_AddEventWatch(event_watcher, screen); + if (screen->video) { + SDL_AddEventWatch(event_watcher, screen); + } #endif static const struct sc_frame_sink_ops ops = {