diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-03-07 16:30:30 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-03-15 12:49:03 +0000 |
commit | 46ab6e3e398c8ccff612bca746ba417ec974f975 (patch) | |
tree | 9241e79926d98efda62368c3e4f42477ff3527d6 | |
parent | 6d9ee7d4c1a03eb2a3b51f2338e39be9f2c0b3ed (diff) | |
download | qtwayland-46ab6e3e398c8ccff612bca746ba417ec974f975.tar.gz |
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.cpp | 3 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandxdgshellv5.cpp | 3 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandxdgshellv6.cpp | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index c3d15c6a..e9089159 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 13a95e17..d696e082 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 3485f80a..cb4a199f 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(); } /*! |