diff options
Diffstat (limited to 'twin/useractions.cpp')
-rw-r--r-- | twin/useractions.cpp | 31 |
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() |