Check that a widget has a window before trying
to update its contents.
---
 ui/gtk.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/ui/gtk.c b/ui/gtk.c
index fd82e9b1ca..e4e0980323 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -340,6 +340,10 @@ static void gd_update_full_redraw(VirtualConsole *vc)
 {
     GtkWidget *area = vc->gfx.drawing_area;
     int ww, wh;
+
+    if (!gtk_widget_get_realized(area)) {
+        return;
+    }
     ww = gdk_window_get_width(gtk_widget_get_window(area));
     wh = gdk_window_get_height(gtk_widget_get_window(area));
 #if defined(CONFIG_OPENGL)
-- 
2.25.1


Reply via email to