summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2024-03-27 10:58:46 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2024-03-29 11:23:31 +0900
commitcc88c98f3884e8446e5cce409fb6d8e6c87b2c96 (patch)
tree1018be9a4d9aae4e086c186dfca9bd84aa6b80db
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 <michele.calgaro@yahoo.it>
-rw-r--r--twin/KWinInterface.h7
-rw-r--r--twin/client.h2
-rw-r--r--twin/geometry.cpp2
-rw-r--r--twin/useractions.cpp31
-rw-r--r--twin/workspace.h7
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();
/**