From f02bb64d62d0eea8fcb4c294f5ec13cd94e3440b Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Wed, 23 Nov 2011 20:46:40 +0100 Subject: [PATCH] shell: Unmap old backgrounds/panels when setting new ones --- compositor/shell.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/compositor/shell.c b/compositor/shell.c index a2ffc0df..74b75e35 100644 --- a/compositor/shell.c +++ b/compositor/shell.c @@ -842,6 +842,15 @@ desktop_shell_set_background(struct wl_client *client, struct wlsc_surface *surface = surface_resource->data; struct shell_surface *priv; + wl_list_for_each(priv, &shell->backgrounds, link) { + if (priv->output == output_resource->data) { + priv->surface->output = NULL; + wl_list_remove(&priv->surface->link); + wl_list_remove(&priv->link); + break; + } + } + priv = get_shell_surface(surface); priv->type = SHELL_SURFACE_BACKGROUND; priv->output = output_resource->data; @@ -868,6 +877,15 @@ desktop_shell_set_panel(struct wl_client *client, struct wlsc_surface *surface = surface_resource->data; struct shell_surface *priv; + wl_list_for_each(priv, &shell->panels, link) { + if (priv->output == output_resource->data) { + priv->surface->output = NULL; + wl_list_remove(&priv->surface->link); + wl_list_remove(&priv->link); + break; + } + } + priv = get_shell_surface(surface); priv->type = SHELL_SURFACE_PANEL; priv->output = output_resource->data;