mirror of
https://github.com/labwc/labwc.git
synced 2026-03-07 04:33:54 -05:00
layer-shell: fix commit handler (issue #71)
On commit, do not arrange layers unless the layer shell-specific state changed or the layer was (un)mapped. Chase swaywm/sway@5fd5d643 and swaywm/wlroots@754f40f9
This commit is contained in:
parent
b040838d6a
commit
73b8f06a26
2 changed files with 14 additions and 1 deletions
|
|
@ -17,6 +17,7 @@ struct lab_layer_surface {
|
||||||
struct wl_listener output_destroy;
|
struct wl_listener output_destroy;
|
||||||
|
|
||||||
struct wlr_box geo;
|
struct wlr_box geo;
|
||||||
|
bool mapped;
|
||||||
};
|
};
|
||||||
|
|
||||||
void layers_init(struct server *server);
|
void layers_init(struct server *server);
|
||||||
|
|
|
||||||
14
src/layers.c
14
src/layers.c
|
|
@ -250,8 +250,20 @@ surface_commit_notify(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct lab_layer_surface *layer =
|
struct lab_layer_surface *layer =
|
||||||
wl_container_of(listener, layer, surface_commit);
|
wl_container_of(listener, layer, surface_commit);
|
||||||
|
struct wlr_layer_surface_v1 *layer_surface = layer->layer_surface;
|
||||||
struct wlr_output *wlr_output = layer->layer_surface->output;
|
struct wlr_output *wlr_output = layer->layer_surface->output;
|
||||||
arrange_layers(output_from_wlr_output(layer->server, wlr_output));
|
|
||||||
|
if (!wlr_output) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (layer_surface->current.committed
|
||||||
|
|| layer->mapped != layer_surface->mapped) {
|
||||||
|
layer->mapped = layer_surface->mapped;
|
||||||
|
struct output *output =
|
||||||
|
output_from_wlr_output(layer->server, wlr_output);
|
||||||
|
arrange_layers(output);
|
||||||
|
}
|
||||||
damage_all_outputs(layer->server);
|
damage_all_outputs(layer->server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue