summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-03-07 16:30:30 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-03-15 12:49:03 +0000
commit46ab6e3e398c8ccff612bca746ba417ec974f975 (patch)
tree9241e79926d98efda62368c3e4f42477ff3527d6
parent6d9ee7d4c1a03eb2a3b51f2338e39be9f2c0b3ed (diff)
Compositor API: Don't try to configure negative sizes
Change-Id: Ie9df312a1926ea5190f6e91268b8920ad519d794 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
-rw-r--r--src/compositor/extensions/qwaylandwlshell.cpp3
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5.cpp3
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv6.cpp4
3 files changed, 7 insertions, 3 deletions
diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp
index c3d15c6aa..e90891592 100644
--- a/src/compositor/extensions/qwaylandwlshell.cpp
+++ b/src/compositor/extensions/qwaylandwlshell.cpp
@@ -523,7 +523,8 @@ QSize QWaylandWlShellSurface::sizeForResize(const QSizeF &size, const QPointF &d
else if (edge & BottomEdge)
height += delta.y();
- return QSizeF(width, height).toSize();
+ QSizeF newSize(qMax(width, 1.0), qMax(height, 1.0));
+ return newSize.toSize();
}
/*!
diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp
index 13a95e17d..d696e082a 100644
--- a/src/compositor/extensions/qwaylandxdgshellv5.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp
@@ -1192,7 +1192,8 @@ QSize QWaylandXdgSurfaceV5::sizeForResize(const QSizeF &size, const QPointF &del
else if (edge & BottomEdge)
height += delta.y();
- return QSizeF(width, height).toSize();
+ QSizeF newSize(qMax(width, 1.0), qMax(height, 1.0));
+ return newSize.toSize();
}
/*!
diff --git a/src/compositor/extensions/qwaylandxdgshellv6.cpp b/src/compositor/extensions/qwaylandxdgshellv6.cpp
index 3485f80a4..cb4a199f4 100644
--- a/src/compositor/extensions/qwaylandxdgshellv6.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv6.cpp
@@ -906,7 +906,9 @@ QSize QWaylandXdgToplevelV6::sizeForResize(const QSizeF &size, const QPointF &de
else if (edges & Qt::BottomEdge)
height += delta.y();
- return QSizeF(width, height).toSize();
+ //TODO: use minSize given by the client here instead
+ QSizeF newSize(qMax(width, 1.0), qMax(height, 1.0));
+ return newSize.toSize();
}
/*!