aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorDongwon Kim <dongwon.kim@intel.com>2021-11-03 23:51:51 -0700
committerGerd Hoffmann <kraxel@redhat.com>2021-11-05 12:29:39 +0100
commit7cf87257f751b5312ff5f151992016a722e273d8 (patch)
tree364c3ab9aa3cafb27a49f11ae601dd63b7b5c1b6 /ui
parent4872a023a593e6519b272a57fea03abe13a7bb00 (diff)
downloadqemu-7cf87257f751b5312ff5f151992016a722e273d8.zip
qemu-7cf87257f751b5312ff5f151992016a722e273d8.tar.gz
qemu-7cf87257f751b5312ff5f151992016a722e273d8.tar.bz2
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 <kraxel@redhat.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Message-Id: <20211104065153.28897-4-dongwon.kim@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index 8da673c..d2892ea 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);