summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2018-09-21 20:37:17 -0500
committerMichael Catanzaro <mcatanzaro@igalia.com>2018-09-21 20:37:17 -0500
commitb9ccd39e24a49e180d38f678a63af4d9548dac4d (patch)
tree7fb329ac0a3677be391f1918af7ab0fef8a5d087
parentf5ad1786e8b2b80408d8df6d2ac2c0748926b20c (diff)
downloadgtk+-mcatanzaro/#1349.tar.gz
wayland: Fix a very-frequent crashermcatanzaro/#1349
This is probably a bandaid rather than a real fix. For some reason, impl->display_server.wl_surface is NULL here, and we crash in that case, so let's not do that. Requires further investigation. Fixes #1349
-rw-r--r--gdk/wayland/gdkwindow-wayland.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 5f162770a0..58bd2744aa 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -766,6 +766,10 @@ gdk_wayland_window_attach_image (GdkWindow *window)
g_assert (_gdk_wayland_is_shm_surface (impl->staging_cairo_surface));
+ /* XXX: Is this correct? */
+ if (!impl->display_server.wl_surface)
+ return;
+
/* Attach this new buffer to the surface */
wl_surface_attach (impl->display_server.wl_surface,
_gdk_wayland_shm_surface_get_wl_buffer (impl->staging_cairo_surface),