summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandxdgshellv6.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/extensions/qwaylandxdgshellv6.cpp')
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv6.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/compositor/extensions/qwaylandxdgshellv6.cpp b/src/compositor/extensions/qwaylandxdgshellv6.cpp
index 0772846fd..d447ac3c8 100644
--- a/src/compositor/extensions/qwaylandxdgshellv6.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv6.cpp
@@ -934,9 +934,14 @@ QSize QWaylandXdgToplevelV6::sizeForResize(const QSizeF &size, const QPointF &de
else if (edges & Qt::BottomEdge)
height += delta.y();
- //TODO: use minSize given by the client here instead
- QSizeF newSize(qMax(width, 1.0), qMax(height, 1.0));
- return newSize.toSize();
+ QSize newSize = QSize(width, height)
+ .expandedTo(minSize())
+ .expandedTo({1, 1}); // We don't want to send a size of (0,0) as that means that the client decides
+
+ if (maxSize().isValid())
+ newSize = newSize.boundedTo(maxSize());
+
+ return newSize;
}
/*!