From b4b6dd3a7537a761ebd128942a5c892c89a3eda9 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Fri, 1 Aug 2014 14:55:49 +0300 Subject: [PATCH] Fix checking initial screen aspect ratio The first time QWaylandScreen gets an output_geometry() event its screen() may not have been initialized yet, so manually check if the output is portrait or landscape. Change-Id: I1d58daee7a3f168a881a1e2d21956c52c09818fc Reviewed-by: Laszlo Agocs --- src/plugins/platforms/wayland/qwaylandscreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandscreen.cpp b/src/plugins/platforms/wayland/qwaylandscreen.cpp index cd709f8a835..3432f247595 100644 --- a/src/plugins/platforms/wayland/qwaylandscreen.cpp +++ b/src/plugins/platforms/wayland/qwaylandscreen.cpp @@ -173,7 +173,7 @@ void QWaylandScreen::output_geometry(int32_t x, int32_t y, Q_UNUSED(subpixel); Q_UNUSED(make); - bool isPortrait = screen() && screen()->primaryOrientation() == Qt::PortraitOrientation; + bool isPortrait = height > width; switch (transform) { case WL_OUTPUT_TRANSFORM_NORMAL: m_orientation = isPortrait ? Qt::PortraitOrientation : Qt::LandscapeOrientation;