From 99c1b8e53f9a2ba6e8c549f15b0d3008bf12c3f1 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Fri, 12 Sep 2014 22:19:45 +0300 Subject: Don't give bogus values for a screen physical size If we don't have a valid physical size for a screen, i.e. (0x0), return the default value from the base class. Change-Id: Ia7b6f90ee73e07014ab752ceb165426812c49415 Reviewed-by: Laszlo Agocs --- src/client/qwaylandscreen.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp index 9c34baeed..943e29a05 100644 --- a/src/client/qwaylandscreen.cpp +++ b/src/client/qwaylandscreen.cpp @@ -97,7 +97,10 @@ QImage::Format QWaylandScreen::format() const QSizeF QWaylandScreen::physicalSize() const { - return mPhysicalSize; + if (mPhysicalSize.isNull()) + return QPlatformScreen::physicalSize(); + else + return mPhysicalSize; } QDpi QWaylandScreen::logicalDpi() const -- cgit v1.2.3