diff options
author | Mavridis Philippe <[email protected]> | 2023-12-05 15:53:55 +0200 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2024-03-29 11:23:31 +0900 |
commit | 7482fe22830ce974a15e3a132dcc3ac6cee1a65f (patch) | |
tree | 42ac4d2e0a6cd7546ee8354eab07f47056437c0a /twin/useractions.cpp | |
parent | 8d642b33a1c5b6b2d0d94e395df83704b3610b55 (diff) | |
download | tdebase-7482fe22830ce974a15e3a132dcc3ac6cee1a65f.tar.gz tdebase-7482fe22830ce974a15e3a132dcc3ac6cee1a65f.zip |
TWin: add tileHorizontally(), tileVertically(), tileGrid() DCOP calls
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'twin/useractions.cpp')
-rw-r--r-- | twin/useractions.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/twin/useractions.cpp b/twin/useractions.cpp index ac017aacf..e22b63af0 100644 --- a/twin/useractions.cpp +++ b/twin/useractions.cpp @@ -664,6 +664,44 @@ void Workspace::showWindowMenu( unsigned long window ) } } +void Workspace::tileHorizontally(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); +} + +void Workspace::tileVertically(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); +} + +void Workspace::tileGrid(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; + + Client *c1 = findClient(WindowMatchPredicate((WId)w1)); + Client *c2 = findClient(WindowMatchPredicate((WId)w2)); + Client *c3 = findClient(WindowMatchPredicate((WId)w3)); + Client *c4 = findClient(WindowMatchPredicate((WId)w4)); + if (!c1 || !c2 || !c3 || !c4) return; + + c1->tile(ActiveTopLeft); + c2->tile(ActiveTopRight); + c3->tile(ActiveBottomLeft); + c4->tile(ActiveBottomRight); +} + void Workspace::slotActivateAttentionWindow() { if( attention_chain.count() > 0 ) |