mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
Fix usable area calculation
Currently if a surface with exclusive zone is created prior to regular surfaces, the size of the exclusize zone does not affect the usable area for regular surfaces. This for example results in notifications being rendered over the statusbar. This commit fixes the issue by handling the surfaces with exclusive zones first. Fixes #420.
This commit is contained in:
parent
a3d3878d28
commit
ef3dbbf29a
1 changed files with 21 additions and 3 deletions
20
src/layers.c
20
src/layers.c
|
|
@ -37,12 +37,30 @@ layers_arrange(struct output *output)
|
|||
int nr_layers = sizeof(output->layers) / sizeof(output->layers[0]);
|
||||
for (int i = 0; i < nr_layers; i++) {
|
||||
struct lab_layer_surface *lab_layer_surface;
|
||||
|
||||
/*
|
||||
* First we go over the list of surfaces that have
|
||||
* exclusive_zone set (e.g. statusbars) because we have to
|
||||
* determine the usable area before processing regular layouts.
|
||||
*/
|
||||
wl_list_for_each(lab_layer_surface, &output->layers[i], link) {
|
||||
struct wlr_scene_layer_surface_v1 *scene_layer_surface =
|
||||
lab_layer_surface->scene_layer_surface;
|
||||
if (scene_layer_surface->layer_surface->current.exclusive_zone) {
|
||||
wlr_scene_layer_surface_v1_configure(
|
||||
scene_layer_surface, &full_area, &usable_area);
|
||||
}
|
||||
}
|
||||
|
||||
/* Now we process regular layouts */
|
||||
wl_list_for_each(lab_layer_surface, &output->layers[i], link) {
|
||||
struct wlr_scene_layer_surface_v1 *scene_layer_surface =
|
||||
lab_layer_surface->scene_layer_surface;
|
||||
if (!scene_layer_surface->layer_surface->current.exclusive_zone) {
|
||||
wlr_scene_layer_surface_v1_configure(
|
||||
scene_layer_surface, &full_area, &usable_area);
|
||||
}
|
||||
}
|
||||
|
||||
wlr_scene_node_set_position(&output->layer_tree[i]->node,
|
||||
scene_output->x, scene_output->y);
|
||||
|
|
@ -350,7 +368,7 @@ new_layer_surface_notify(struct wl_listener *listener, void *data)
|
|||
return;
|
||||
}
|
||||
|
||||
wl_list_insert(&output->layers[layer_surface->pending.layer],
|
||||
wl_list_insert(output->layers[layer_surface->pending.layer].prev,
|
||||
&surface->link);
|
||||
/*
|
||||
* Temporarily set the layer's current state to pending so that
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue