diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2024-11-13 17:48:10 +0200 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2024-11-19 19:10:45 +0200 |
commit | c913d416f7102f9d091c39dfd32db9b802f32983 (patch) | |
tree | 8b5482a0f089a87d37fa204e724d2c78857b08f4 /twin/workspace.cpp | |
parent | 1afb78e598cc0d8c320e98c963cb98ab7935435f (diff) | |
download | tdebase-feat/grid-tiling.tar.gz tdebase-feat/grid-tiling.zip |
TWin: add "Grid tiling" featurefeat/grid-tiling
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'twin/workspace.cpp')
-rw-r--r-- | twin/workspace.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/twin/workspace.cpp b/twin/workspace.cpp index 23661e6a0..26ff7c2b6 100644 --- a/twin/workspace.cpp +++ b/twin/workspace.cpp @@ -2519,6 +2519,19 @@ void Workspace::unreserveActiveBorder( ActiveBorder border ) TQTimer::singleShot(0, this, TQ_SLOT(updateActiveBorders())); } +void Workspace::checkGridTiling(const TQPoint &pos, TQSize &gridSize) +{ + TQSize tileSize = movingClient->gridTileSize(); + TQRect area = clientArea(MaximizeArea, pos, currentDesktop()); + + // Compute target geometry based on current pos + int x = 0, y = 0; + while (x + tileSize.width() < pos.x() && x < area.width()) x += tileSize.width(); + while (y + tileSize.height() < pos.y() && y < area.height()) y += tileSize.height(); + + movingClient->handleGridTiling(TQRect(x, y, tileSize.width(), tileSize.height())); +} + void Workspace::checkActiveBorder(const TQPoint &pos, Time now) { Time treshold_set = options->activeBorderDelay(); // set timeout |