mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
view: implement cascade placement policy
Adds following settings:
<placement>
<policy>cascade</policy>
<cascadeOffset x="40" y="30" />
</placement>
"Cascade" policy places a new window at the center of the screen like
"center" policy, but possibly shifts its position to bottom-right so the
new window doesn't cover existing windows.
The algorithm is copied from KWin's implementation:
df9f8f8346/src/placement.cpp (L589)
Also added some helper functions to manipulate `wlr_box`.
This commit is contained in:
parent
3be8fe25f3
commit
46ec513630
10 changed files with 199 additions and 17 deletions
|
|
@ -901,6 +901,10 @@ entry(xmlNode *node, char *nodename, char *content)
|
|||
}
|
||||
} else if (!strcasecmp(nodename, "xwaylandPersistence.core")) {
|
||||
set_bool(content, &rc.xwayland_persistence);
|
||||
} else if (!strcasecmp(nodename, "x.cascadeOffset.placement")) {
|
||||
rc.placement_cascade_offset_x = atoi(content);
|
||||
} else if (!strcasecmp(nodename, "y.cascadeOffset.placement")) {
|
||||
rc.placement_cascade_offset_y = atoi(content);
|
||||
} else if (!strcmp(nodename, "name.theme")) {
|
||||
rc.theme_name = xstrdup(content);
|
||||
} else if (!strcmp(nodename, "cornerradius.theme")) {
|
||||
|
|
@ -1234,6 +1238,8 @@ rcxml_init(void)
|
|||
has_run = true;
|
||||
|
||||
rc.placement_policy = LAB_PLACE_CENTER;
|
||||
rc.placement_cascade_offset_x = 0;
|
||||
rc.placement_cascade_offset_y = 0;
|
||||
|
||||
rc.xdg_shell_server_side_deco = true;
|
||||
rc.ssd_keep_border = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue