diff mbox series

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

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

Commit Message

Kim, Dongwon Nov. 4, 2021, 6:51 a.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);