aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-03-26 18:35:09 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-03-26 18:35:09 +0000
commit4ad9e2b36e1e00fe5b96c3448ecd673e11c4d6d8 (patch)
tree1ff85d4b9d5f9248fff4f7bc477256eb8b576b44
parentf75d4f82950c9e74c7202081f1cb97ae94b7c7d8 (diff)
parent4cdfc93526364bc9b20a21c9edd802d737cec85f (diff)
Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-20150326-1' into staging
gtk: do not call gtk_widget_get_window if drawing area is not initialized # gpg: Signature made Thu Mar 26 16:59:55 2015 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-gtk-20150326-1: gtk: do not call gtk_widget_get_window if drawing area is not initialized Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--ui/gtk.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index 6a81076ffc..51abac9f47 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -294,6 +294,10 @@ static void gd_update_cursor(VirtualConsole *vc)
return;
}
+ if (!gtk_widget_get_realized(vc->gfx.drawing_area)) {
+ return;
+ }
+
window = gtk_widget_get_window(GTK_WIDGET(vc->gfx.drawing_area));
if (s->full_screen || qemu_input_is_absolute() || s->ptr_owner == vc) {
gdk_window_set_cursor(window, s->null_cursor);
@@ -458,6 +462,10 @@ static void gd_update(DisplayChangeListener *dcl,
trace_gd_update(vc->label, x, y, w, h);
+ if (!gtk_widget_get_realized(vc->gfx.drawing_area)) {
+ return;
+ }
+
if (vc->gfx.convert) {
pixman_image_composite(PIXMAN_OP_SRC, vc->gfx.ds->image,
NULL, vc->gfx.convert,
@@ -540,6 +548,10 @@ static void gd_cursor_define(DisplayChangeListener *dcl,
GdkPixbuf *pixbuf;
GdkCursor *cursor;
+ if (!gtk_widget_get_realized(vc->gfx.drawing_area)) {
+ return;
+ }
+
pixbuf = gdk_pixbuf_new_from_data((guchar *)(c->data),
GDK_COLORSPACE_RGB, true, 8,
c->width, c->height, c->width * 4,