xwayland: Make sure to clear an existing surface if we have one

This fixes an assert fail when redecorating an X11 client.
This commit is contained in:
Jasper St. Pierre 2014-03-11 10:23:35 -04:00
parent 84c6b2a3fa
commit 9df8e831be

View File

@ -47,6 +47,13 @@ xserver_set_window_id (struct wl_client *client,
if (!window) if (!window)
return; return;
/* If the window has an existing surface, like if we're
* undecorating or decorating the window, then we need
* to detach the window from its old surface.
*/
if (window->surface)
window->surface->window = NULL;
meta_wayland_surface_make_toplevel (surface); meta_wayland_surface_make_toplevel (surface);
surface->window = window; surface->window = window;