Fix layer surface commit handler

Fixes: c11b5db4d6 ("layer-shell: check `committed` bitmask")
This commit is contained in:
Simon Ser 2021-09-24 16:16:16 +02:00
parent c11b5db4d6
commit fe4942e078

View file

@ -297,18 +297,19 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) {
if (wlr_output == NULL) { if (wlr_output == NULL) {
return; return;
} }
if (layer_surface->current.committed == 0) {
// The layer surface state didn't change
return;
}
struct sway_output *output = wlr_output->data; struct sway_output *output = wlr_output->data;
struct wlr_box old_extent = layer->extent; struct wlr_box old_extent = layer->extent;
arrange_layers(output); bool layer_changed =
layer_surface->current.committed & WLR_LAYER_SURFACE_V1_STATE_LAYER;
bool extent_changed = false;
if (layer_surface->current.committed != 0) {
arrange_layers(output);
extent_changed = memcmp(&old_extent, &layer->extent,
sizeof(struct wlr_box)) != 0;
}
bool extent_changed =
memcmp(&old_extent, &layer->extent, sizeof(struct wlr_box)) != 0;
bool layer_changed = layer->layer != layer_surface->current.layer;
if (layer_changed) { if (layer_changed) {
wl_list_remove(&layer->link); wl_list_remove(&layer->link);
wl_list_insert(&output->layers[layer_surface->current.layer], wl_list_insert(&output->layers[layer_surface->current.layer],