From fb20442ffde3f5b5c7c2ee5d83eafb4b87572f48 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Mon, 17 Oct 2022 08:35:24 +0200 Subject: [PATCH] VIDEO: Not all events come with a valid windowID. --- sim_video.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sim_video.c b/sim_video.c index 198c80b1..0ec30e2b 100644 --- a/sim_video.c +++ b/sim_video.c @@ -2076,12 +2076,14 @@ while (vid_active) { event.user.code = 0; /* Mark as done */ continue; } - vptr = vid_get_event_window (&event, event.user.windowID); - if (vptr == NULL) { - sim_debug (SIM_VID_DBG_VIDEO, vptr->vid_dev, "vid_thread() - Ignored event not bound to a window\n"); - event.user.code = 0; /* Mark as done */ - break; + if (event.user.code != EVENT_OPEN) { + vptr = vid_get_event_window (&event, event.user.windowID); + if (vptr == NULL) { + sim_debug (SIM_VID_DBG_VIDEO, vptr->vid_dev, "vid_thread() - Ignored event not bound to a window\n"); + event.user.code = 0; /* Mark as done */ + break; } + } if (event.user.code == EVENT_REDRAW) { vid_update (vptr); event.user.code = 0; /* Mark as done */