summaryrefslogtreecommitdiffstats
path: root/twin/useractions.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2024-03-27 10:58:46 +0900
committerMichele Calgaro <[email protected]>2024-03-29 11:23:31 +0900
commitcc88c98f3884e8446e5cce409fb6d8e6c87b2c96 (patch)
tree1018be9a4d9aae4e086c186dfca9bd84aa6b80db /twin/useractions.cpp
parent7482fe22830ce974a15e3a132dcc3ac6cee1a65f (diff)
downloadtdebase-cc88c98f3884e8446e5cce409fb6d8e6c87b2c96.tar.gz
tdebase-cc88c98f3884e8446e5cce409fb6d8e6c87b2c96.zip
twin: add tileWindowToBorder() and rename previously introduced tileHorizontally(), tileVertically(), tileGrid() DCOP calls
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'twin/useractions.cpp')
-rw-r--r--twin/useractions.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/twin/useractions.cpp b/twin/useractions.cpp
index e22b63af0..567255fa5 100644
--- a/twin/useractions.cpp
+++ b/twin/useractions.cpp
@@ -664,29 +664,38 @@ void Workspace::showWindowMenu( unsigned long window )
}
}
-void Workspace::tileHorizontally(unsigned long w1, unsigned long w2) {
+void Workspace::tileWindowToBorder(unsigned long w1, int location) {
+ if (location < ActiveTop || location >= ACTIVE_BORDER_COUNT) return;
+
+ Client *c1 = findClient(WindowMatchPredicate((WId)w1));
+ if (!c1) return;
+
+ c1->tileToBorder((ActiveBorder)location);
+}
+
+void Workspace::tileTwoWindowsHorizontally(unsigned long w1, unsigned long w2) {
if (w1 == w2) return;
Client *c1 = findClient(WindowMatchPredicate((WId)w1));
Client *c2 = findClient(WindowMatchPredicate((WId)w2));
if (!c1 || !c2) return;
- c1->tile(ActiveTop);
- c2->tile(ActiveBottom);
+ c1->tileToBorder(ActiveTop);
+ c2->tileToBorder(ActiveBottom);
}
-void Workspace::tileVertically(unsigned long w1, unsigned long w2) {
+void Workspace::tileTwoWindowsVertically(unsigned long w1, unsigned long w2) {
if (w1 == w2) return;
Client *c1 = findClient(WindowMatchPredicate((WId)w1));
Client *c2 = findClient(WindowMatchPredicate((WId)w2));
if (!c1 || !c2) return;
- c1->tile(ActiveLeft);
- c2->tile(ActiveRight);
+ c1->tileToBorder(ActiveLeft);
+ c2->tileToBorder(ActiveRight);
}
-void Workspace::tileGrid(unsigned long w1, unsigned long w2, unsigned long w3, unsigned long w4) {
+void Workspace::tileFourWindowsInGrid(unsigned long w1, unsigned long w2, unsigned long w3, unsigned long w4) {
if (w1 == w2 || w1 == w3 || w1 == w4 || w2 == w3 || w2 == w4 || w3 == w4)
return;
@@ -696,10 +705,10 @@ void Workspace::tileGrid(unsigned long w1, unsigned long w2, unsigned long w3, u
Client *c4 = findClient(WindowMatchPredicate((WId)w4));
if (!c1 || !c2 || !c3 || !c4) return;
- c1->tile(ActiveTopLeft);
- c2->tile(ActiveTopRight);
- c3->tile(ActiveBottomLeft);
- c4->tile(ActiveBottomRight);
+ c1->tileToBorder(ActiveTopLeft);
+ c2->tileToBorder(ActiveTopRight);
+ c3->tileToBorder(ActiveBottomLeft);
+ c4->tileToBorder(ActiveBottomRight);
}
void Workspace::slotActivateAttentionWindow()