diff mbox series

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

Message ID 20210917001320.6515-4-dongwon.kim@intel.com (mailing list archive)
State New, archived
Headers show
Series ui/gtk-egl: fix for untab/tab problem | expand

Commit Message

Kim, Dongwon Sept. 17, 2021, 12:13 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 92df3d4c5c..5346c331f4 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);