diff mbox series

[4/4] ui/gtk: gd_draw_event returns FALSE when no cairo surface is bound

Message ID 20211102223632.20466-4-dongwon.kim@intel.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/4] ui/gtk-egl: un-tab and re-tab should destroy egl surface and context | expand

Commit Message

Kim, Dongwon Nov. 2, 2021, 10:36 p.m. UTC
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>
---
 ui/gtk.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

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);