mirror of
https://github.com/labwc/labwc.git
synced 2026-02-15 22:05:25 -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
|
|
@ -276,9 +276,9 @@ Actions are used in menus and keyboard/mouse bindings.
|
|||
*<action name="AutoPlace" policy="value"/>*
|
||||
Reposition the window according to the desired placement policy.
|
||||
|
||||
*policy* [automatic|cursor|center] Use the specified policy, which has
|
||||
the same meaning as the corresponding value for *<placement><policy>*.
|
||||
Default is automatic.
|
||||
*policy* [automatic|cursor|center|cascade] Use the specified policy,
|
||||
which has the same meaning as the corresponding value for
|
||||
*<placement><policy>*. Default is automatic.
|
||||
|
||||
*<action name="Shade" />*++
|
||||
*<action name="Unshade" />*++
|
||||
|
|
|
|||
|
|
@ -203,12 +203,22 @@ this is for compatibility with Openbox.
|
|||
|
||||
## PLACEMENT
|
||||
|
||||
*<placement><policy>* [center|automatic|cursor]
|
||||
*<placement><policy>* [center|automatic|cursor|cascade]
|
||||
Specify a placement policy for new windows. The "center" policy will
|
||||
always place windows at the center of the active output. The "automatic"
|
||||
policy will try to place new windows in such a way that they will
|
||||
have minimal overlap with existing windows. The "cursor" policy will
|
||||
center new windows under the cursor. Default is "center".
|
||||
center new windows under the cursor. The "cascade" policy will try to
|
||||
place new windows at the center of the active output, but possibly
|
||||
shifts its position to bottom-right not to cover existing windows.
|
||||
Default is "center".
|
||||
|
||||
*<placement><cascadeOffset><x>*++
|
||||
*<placement><cascadeOffset><y>*
|
||||
Specify the offset by which a new window can be shifted from an existing
|
||||
window when <placement><policy> is "cascade". These values must be positive.
|
||||
Default is the height of titlebar (the sum of *titlebar.height* and
|
||||
*border.width* from theme) plus 5 for both *x* and *y*.
|
||||
|
||||
## WINDOW SWITCHER
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,11 @@
|
|||
|
||||
<placement>
|
||||
<policy>center</policy>
|
||||
<!--
|
||||
When <placement><policy> is "cascade", the offset for cascading new
|
||||
windows can be overwritten like this:
|
||||
<cascadeOffset x="40" y="30" />
|
||||
-->
|
||||
</placement>
|
||||
|
||||
<!-- <font><theme> can be defined without an attribute to set all places -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue