]> git.mdlowis.com Git - proto/labwc.git/commit
view: implement `cascade` placement policy
authortokyo4j <hrak1529@gmail.com>
Fri, 3 May 2024 21:26:27 +0000 (06:26 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 20 Jul 2024 07:59:46 +0000 (08:59 +0100)
commit46ec513630f60a4ab14b5677c1a5b10f23e60db2
tree079308bd230d30f3040d9e8db5bc94428e8ecca4
parent3be8fe25f33bdf968a28aeffc08a370ab2d38b49
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:
https://github.com/KDE/kwin/blob/df9f8f8346b5b7645578e37365dabb1a7b02ca5a/src/placement.cpp#L589

Also added some helper functions to manipulate `wlr_box`.
docs/labwc-actions.5.scd
docs/labwc-config.5.scd
docs/rc.xml.all
include/common/box.h [new file with mode: 0644]
include/config/rcxml.h
src/common/box.c [new file with mode: 0644]
src/common/meson.build
src/config/rcxml.c
src/edges.c
src/view.c