From 7cf87257f751b5312ff5f151992016a722e273d8 Mon Sep 17 00:00:00 2001 From: Dongwon Kim Date: Wed, 3 Nov 2021 23:51:51 -0700 Subject: [PATCH] ui/gtk: gd_draw_event returns FALSE when no cairo surface is bound gd_draw_event shouldn't try to repaint if surface does not exist for the VC. Cc: Gerd Hoffmann Signed-off-by: Dongwon Kim Message-Id: <20211104065153.28897-4-dongwon.kim@intel.com> Signed-off-by: Gerd Hoffmann --- ui/gtk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/gtk.c b/ui/gtk.c index 8da673c18c..d2892ea6b4 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -778,6 +778,9 @@ static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque) if (!vc->gfx.ds) { return FALSE; } + if (!vc->gfx.surface) { + return FALSE; + } vc->gfx.dcl.update_interval = gd_monitor_update_interval(vc->window ? vc->window : s->window);