From 6926c6d9f803fcdf1dedbac7433508438e7c1c60 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 19 Jun 2014 15:10:01 -0400 Subject: [PATCH] gdkwindow-wayland: Destroy the xdg roles before the wl_surface Since the xdg roles are a special case of the surface, some compositors like Weston destroy them automatically when the wl_surface is destroyed. Thus, we need to destroy these first. --- gdk/wayland/gdkwindow-wayland.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index b8d341efc2..036700972c 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -1075,6 +1075,17 @@ gdk_wayland_window_hide_surface (GdkWindow *window, if (impl->surface) { + if (impl->xdg_surface) + { + xdg_surface_destroy (impl->xdg_surface); + impl->xdg_surface = NULL; + } + else if (impl->xdg_popup) + { + xdg_popup_destroy (impl->xdg_popup); + impl->xdg_popup = NULL; + } + if (!is_destroy) { wl_surface_attach (impl->surface, NULL, 0, 0); @@ -1088,17 +1099,6 @@ gdk_wayland_window_hide_surface (GdkWindow *window, g_slist_free (impl->outputs); impl->outputs = NULL; } - - if (impl->xdg_surface) - { - xdg_surface_destroy (impl->xdg_surface); - impl->xdg_surface = NULL; - } - else if (impl->xdg_popup) - { - xdg_popup_destroy (impl->xdg_popup); - impl->xdg_popup = NULL; - } } impl->mapped = FALSE;