diff options
author | Michele Calgaro <[email protected]> | 2024-03-27 10:58:46 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2024-03-29 11:25:20 +0900 |
commit | 577b0ec106ca8a4e6072f3a05db137892d129840 (patch) | |
tree | db8529ef3663fb4f6c160e438a5ebd7a1400e350 /twin | |
parent | 62ce84146e5a9505e59121b9ab65f9e32704f16f (diff) | |
download | tdebase-577b0ec106ca8a4e6072f3a05db137892d129840.tar.gz tdebase-577b0ec106ca8a4e6072f3a05db137892d129840.zip |
twin: add tileWindowToBorder() and rename previously introduced tileHorizontally(), tileVertically(), tileGrid() DCOP calls
Signed-off-by: Michele Calgaro <[email protected]>
(cherry picked from commit cc88c98f3884e8446e5cce409fb6d8e6c87b2c96)
Diffstat (limited to 'twin')
-rw-r--r-- | twin/KWinInterface.h | 7 | ||||
-rw-r--r-- | twin/client.h | 2 | ||||
-rw-r--r-- | twin/geometry.cpp | 2 | ||||
-rw-r--r-- | twin/useractions.cpp | 31 | ||||
-rw-r--r-- | twin/workspace.h | 7 |
5 files changed, 30 insertions, 19 deletions
diff --git a/twin/KWinInterface.h b/twin/KWinInterface.h index 34e35a5bd..37fe2d9b6 100644 --- a/twin/KWinInterface.h +++ b/twin/KWinInterface.h @@ -29,9 +29,10 @@ class KWinInterface : virtual public DCOPObject virtual void circulateDesktopApplications() = 0; virtual void updateOverlappingShadows(unsigned long window) = 0; virtual void setShadowed(unsigned long window, bool shadowed) = 0; - virtual void tileHorizontally(unsigned long w1, unsigned long w2) = 0; - virtual void tileVertically(unsigned long w1, unsigned long w2) = 0; - virtual void tileGrid(unsigned long w1, unsigned long w2, unsigned long w3, unsigned long w4) = 0; + virtual void tileWindowToBorder(unsigned long w1, int location) = 0; + virtual void tileTwoWindowsHorizontally(unsigned long w1, unsigned long w2) = 0; + virtual void tileTwoWindowsVertically(unsigned long w1, unsigned long w2) = 0; + virtual void tileFourWindowsInGrid(unsigned long w1, unsigned long w2, unsigned long w3, unsigned long w4) = 0; // kompmgr stuff virtual void startKompmgr() = 0; diff --git a/twin/client.h b/twin/client.h index 30cf7bc8d..a59b20acd 100644 --- a/twin/client.h +++ b/twin/client.h @@ -240,7 +240,7 @@ class Client : public TQObject, public KDecorationDefines void cancelActiveBorderMaximizing(); bool isActiveBorderMaximizing() const; TQRect activeBorderMaximizeGeometry(); - void tile(ActiveBorder border); + void tileToBorder(ActiveBorder border); void growHorizontal(); void shrinkHorizontal(); diff --git a/twin/geometry.cpp b/twin/geometry.cpp index 34117da20..581c07ac1 100644 --- a/twin/geometry.cpp +++ b/twin/geometry.cpp @@ -2828,7 +2828,7 @@ TQRect Client::activeBorderMaximizeGeometry() return ret; } -void Client::tile(ActiveBorder border) { +void Client::tileToBorder(ActiveBorder border) { if (!isResizable()) return; activeTiled = true; setActiveBorderMode(ActiveTilingMode); 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() diff --git a/twin/workspace.h b/twin/workspace.h index b6f97f1a8..9c5e55203 100644 --- a/twin/workspace.h +++ b/twin/workspace.h @@ -207,9 +207,10 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void showWindowMenuAt( unsigned long id, int x, int y ); void showWindowMenu( unsigned long id ); - void tileHorizontally(unsigned long w1, unsigned long w2); - void tileVertically(unsigned long w1, unsigned long w2); - void tileGrid(unsigned long w1, unsigned long w2, unsigned long w3, unsigned long w4); + void tileWindowToBorder(unsigned long w1, int location); + void tileTwoWindowsHorizontally(unsigned long w1, unsigned long w2); + void tileTwoWindowsVertically(unsigned long w1, unsigned long w2); + void tileFourWindowsInGrid(unsigned long w1, unsigned long w2, unsigned long w3, unsigned long w4); void kDestopResized(); /** |