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.
This commit is contained in:
Jasper St. Pierre 2014-06-19 15:10:01 -04:00
parent b35820fa3c
commit 6926c6d9f8

View File

@ -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;