From 626094ad130225df0bcd319656c97fe44c7024e7 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 12 Feb 2021 23:18:13 +0100 Subject: [PATCH] Handle window events only once visible This will avoid corner cases where we need to resize while no frame has been received yet. --- app/src/scrcpy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index 747e25a6..505b5eaf 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -184,7 +184,9 @@ handle_event(SDL_Event *event, const struct scrcpy_options *options) { } break; case SDL_WINDOWEVENT: - screen_handle_window_event(&screen, &event->window); + if (screen.has_frame) { + screen_handle_window_event(&screen, &event->window); + } break; case SDL_TEXTINPUT: if (!options->control) {