diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-11-23 20:46:40 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-11-23 20:46:40 +0100 |
commit | f02bb64d62d0eea8fcb4c294f5ec13cd94e3440b (patch) | |
tree | 1db3360b490ad360f452831cbb6759eca5d8fbac | |
parent | d0f79ab5ab8ba7c1e8715670f21370352f878f3f (diff) |
shell: Unmap old backgrounds/panels when setting new onesshell-outputs-2
-rw-r--r-- | compositor/shell.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/compositor/shell.c b/compositor/shell.c index a2ffc0d..74b75e3 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; |