From c131c44ef64e4d98f1a8d8688cb41078f60c2239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 15 Dec 2016 19:34:10 +0800 Subject: [PATCH] gtk-embed: Don't try to compare with unrealized window After having embedded a Gtk window, we start to listen for the corresponding MetaWindow to know when it has been mapped by the compositor. If the embedder does not realize the window immediately, and some other window is created and mapped before the embedder realizes the window, we would prior to this patch try to dereference the not created GdkWindow. Fix this by NULL checking the GdkWindow before dereferencing. We will never miss the needed MetaWindow creation since it can not have been mapped have it not yet been realized. https://bugzilla.gnome.org/show_bug.cgi?id=776130 --- src/shell-gtk-embed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell-gtk-embed.c b/src/shell-gtk-embed.c index 3f306136f..176b41320 100644 --- a/src/shell-gtk-embed.c +++ b/src/shell-gtk-embed.c @@ -66,7 +66,7 @@ shell_gtk_embed_window_created_cb (MetaDisplay *display, Window xwindow = meta_window_get_xwindow (window); GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (priv->window)); - if (xwindow == gdk_x11_window_get_xid (gdk_window)) + if (gdk_window && xwindow == gdk_x11_window_get_xid (gdk_window)) { ClutterActor *window_actor = CLUTTER_ACTOR (meta_window_get_compositor_private (window));