mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
region: Add output pointer to struct region
This commit is contained in:
parent
e0388ba8bf
commit
fe7edf82d9
2 changed files with 4 additions and 7 deletions
|
|
@ -15,6 +15,7 @@ struct multi_rect;
|
||||||
/* Double use: rcxml.c for config and output.c for usage */
|
/* Double use: rcxml.c for config and output.c for usage */
|
||||||
struct region {
|
struct region {
|
||||||
struct wl_list link; /* struct rcxml.regions, struct output.regions */
|
struct wl_list link; /* struct rcxml.regions, struct output.regions */
|
||||||
|
struct output *output;
|
||||||
char *name;
|
char *name;
|
||||||
struct wlr_box geo;
|
struct wlr_box geo;
|
||||||
struct wlr_box percentage;
|
struct wlr_box percentage;
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,7 @@ regions_reconfigure_output(struct output *output)
|
||||||
wl_list_for_each(region, &rc.regions, link) {
|
wl_list_for_each(region, &rc.regions, link) {
|
||||||
struct region *region_new = znew(*region_new);
|
struct region *region_new = znew(*region_new);
|
||||||
/* Create a copy */
|
/* Create a copy */
|
||||||
|
region_new->output = output;
|
||||||
region_new->name = xstrdup(region->name);
|
region_new->name = xstrdup(region->name);
|
||||||
region_new->percentage = region->percentage;
|
region_new->percentage = region->percentage;
|
||||||
wl_list_append(&output->regions, ®ion_new->link);
|
wl_list_append(&output->regions, ®ion_new->link);
|
||||||
|
|
@ -214,14 +215,9 @@ regions_evacuate_output(struct output *output)
|
||||||
{
|
{
|
||||||
assert(output);
|
assert(output);
|
||||||
struct view *view;
|
struct view *view;
|
||||||
struct region *region;
|
|
||||||
|
|
||||||
wl_list_for_each(view, &output->server->views, link) {
|
wl_list_for_each(view, &output->server->views, link) {
|
||||||
wl_list_for_each(region, &output->regions, link) {
|
if (view->tiled_region && view->tiled_region->output == output) {
|
||||||
if (view->tiled_region == region) {
|
view_evacuate_region(view);
|
||||||
view_evacuate_region(view);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue