|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
From 62559b44a1bcfb1ab2924100dba4f5a01acd65cc Mon Sep 17 00:00:00 2001
|
|
|
|
|
From 807661611e2fa41179e5615abdfcca5ff2a7f4c1 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Jacopo De Simoi <jacopods@gmail.com>
|
|
|
|
|
Date: Sun, 28 Oct 2018 02:26:37 -0400
|
|
|
|
|
Subject: [PATCH 12/22] Implement Incremental wide-placement
|
|
|
|
|
@ -6,12 +6,14 @@ Subject: [PATCH 12/22] Implement Incremental wide-placement |
|
|
|
|
[hyper-wide] Fix placement with fractional scaling
|
|
|
|
|
|
|
|
|
|
[squashme] Fix compilation
|
|
|
|
|
|
|
|
|
|
Skip X Wayland Video Bridge when placing windows
|
|
|
|
|
---
|
|
|
|
|
src/placement.cpp | 149 ++++++++++++++++++++++++++++++++++------------
|
|
|
|
|
1 file changed, 112 insertions(+), 37 deletions(-)
|
|
|
|
|
src/placement.cpp | 153 +++++++++++++++++++++++++++++++++++-----------
|
|
|
|
|
1 file changed, 116 insertions(+), 37 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/src/placement.cpp b/src/placement.cpp
|
|
|
|
|
index 815738cb7d..f82ca0b21d 100644
|
|
|
|
|
index adf307cb3b..2bc2cbd7cb 100644
|
|
|
|
|
--- a/src/placement.cpp
|
|
|
|
|
+++ b/src/placement.cpp
|
|
|
|
|
@@ -163,13 +163,24 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
@ -39,19 +41,22 @@ index 815738cb7d..f82ca0b21d 100644 |
|
|
|
|
int x_optimal, y_optimal;
|
|
|
|
|
int possible;
|
|
|
|
|
VirtualDesktop *const desktop = window->isOnCurrentDesktop() ? VirtualDesktopManager::self()->currentDesktop() : window->desktops().front();
|
|
|
|
|
@@ -179,46 +190,70 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
@@ -179,46 +190,74 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
int basket; // temp holder
|
|
|
|
|
|
|
|
|
|
// get the maximum allowed windows space
|
|
|
|
|
- int x = area.left();
|
|
|
|
|
- int y = area.top();
|
|
|
|
|
+
|
|
|
|
|
+ QRectF preMaxRect = area;
|
|
|
|
|
+ RectF preMaxRect = area;
|
|
|
|
|
+ preMaxRect.setWidth(preMaxRect.width() * 10);
|
|
|
|
|
+
|
|
|
|
|
+ const QRectF maxRect = preMaxRect;
|
|
|
|
|
+ const RectF maxRect = preMaxRect;
|
|
|
|
|
+ int mrh = maxRect.height() * scale;
|
|
|
|
|
+
|
|
|
|
|
+ // the rounding below assumes (wrongly) that the topleft corner is
|
|
|
|
|
+ // at integer coordinates
|
|
|
|
|
+
|
|
|
|
|
+ // Our first guess is the topleft corner
|
|
|
|
|
+ int x = std::round(maxRect.left() * scale) + gapSize;
|
|
|
|
|
+ int y = std::round(maxRect.top() * scale) + gapSize;
|
|
|
|
|
@ -108,7 +113,8 @@ index 815738cb7d..f82ca0b21d 100644 |
|
|
|
|
auto client = *l;
|
|
|
|
|
- if (isIrrelevant(client, window, desktop)) {
|
|
|
|
|
+ if (isIrrelevant(client, window, desktop)
|
|
|
|
|
+ || client->isDock()) {
|
|
|
|
|
+ || client->isDock()
|
|
|
|
|
+ || client->skipPager()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
- xl = client->x();
|
|
|
|
|
@ -124,7 +130,7 @@ index 815738cb7d..f82ca0b21d 100644 |
|
|
|
|
// if windows overlap, calc the overall overlapping
|
|
|
|
|
if ((cxl < xr) && (cxr > xl) && (cyt < yb) && (cyb > yt)) {
|
|
|
|
|
xl = std::max(cxl, xl);
|
|
|
|
|
@@ -235,9 +270,13 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
@@ -235,9 +274,13 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -140,7 +146,7 @@ index 815738cb7d..f82ca0b21d 100644 |
|
|
|
|
x_optimal = x;
|
|
|
|
|
y_optimal = y;
|
|
|
|
|
break;
|
|
|
|
|
@@ -246,22 +285,40 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
@@ -246,22 +289,40 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
if (first_pass) {
|
|
|
|
|
first_pass = false;
|
|
|
|
|
min_overlap = overlap;
|
|
|
|
|
@ -183,7 +189,7 @@ index 815738cb7d..f82ca0b21d 100644 |
|
|
|
|
// compare to the position of each client on the same desk
|
|
|
|
|
for (auto l = workspace()->stackingOrder().constBegin(); l != workspace()->stackingOrder().constEnd(); ++l) {
|
|
|
|
|
auto client = *l;
|
|
|
|
|
@@ -269,32 +326,44 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
@@ -269,32 +330,44 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -238,7 +244,7 @@ index 815738cb7d..f82ca0b21d 100644 |
|
|
|
|
|
|
|
|
|
if (possible - ch > y) {
|
|
|
|
|
possible -= ch;
|
|
|
|
|
@@ -307,10 +376,10 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
@@ -307,10 +380,10 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -253,7 +259,7 @@ index 815738cb7d..f82ca0b21d 100644 |
|
|
|
|
|
|
|
|
|
// if not enough room to the left or right of the current tested client
|
|
|
|
|
// determine the first non-overlapped y position
|
|
|
|
|
@@ -318,20 +387,26 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
@@ -318,20 +391,26 @@ std::optional<PlacementCommand> Placement::placeSmart(const Window *window, cons
|
|
|
|
|
possible = yb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -286,5 +292,5 @@ index 815738cb7d..f82ca0b21d 100644 |
|
|
|
|
|
|
|
|
|
QPointF Workspace::cascadeOffset(const RectF &area) const
|
|
|
|
|
--
|
|
|
|
|
2.52.0
|
|
|
|
|
2.53.0
|
|
|
|
|
|
|
|
|
|
|