shell: Unmap old backgrounds/panels when setting new ones
This commit is contained in:
parent
d0f79ab5ab
commit
f02bb64d62
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue