diff options
author | Simon Ser <contact@emersion.fr> | 2019-10-23 19:39:47 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-10-27 11:07:18 -0400 |
commit | ad078865438845f1f4732f05414d1fdd3a69560e (patch) | |
tree | 480a8bc4fb144d00e4e137570ef93a4da7bde298 /sway/desktop | |
parent | 7c9b71f5c61764be2e1459750dcd7978b8f45e5b (diff) | |
download | sway-ad078865438845f1f4732f05414d1fdd3a69560e.tar.xz |
Handle layer changes for layer shell surfaces
Closes: https://github.com/swaywm/sway/issues/4644
References: https://github.com/emersion/rootston/commit/1982106c9b0fbd48ee9fe20e013524125f6ca3cf
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/layer_shell.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index 5f2b74cd..9289bb4a 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c @@ -277,7 +277,17 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) { struct sway_output *output = wlr_output->data; struct wlr_box old_geo = layer->geo; arrange_layers(output); - if (memcmp(&old_geo, &layer->geo, sizeof(struct wlr_box)) != 0) { + + bool geo_changed = + memcmp(&old_geo, &layer->geo, sizeof(struct wlr_box)) != 0; + bool layer_changed = layer->layer != layer_surface->current.layer; + if (layer_changed) { + wl_list_remove(&layer->link); + wl_list_insert(&output->layers[layer_surface->current.layer], + &layer->link); + layer->layer = layer_surface->current.layer; + } + if (geo_changed || layer_changed) { output_damage_surface(output, old_geo.x, old_geo.y, layer_surface->surface, true); output_damage_surface(output, layer->geo.x, layer->geo.y, |