[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 1/2] gtk: Make sure widget is realized before updating
From: |
Damian Hobson-Garcia |
Subject: |
[RFC PATCH 1/2] gtk: Make sure widget is realized before updating |
Date: |
Wed, 8 Mar 2023 11:25:47 -0500 |
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