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 <laszlo.agocs@digia.com>
This commit is contained in:
Giulio Camuffo 2014-08-01 14:55:49 +03:00
parent 1cb65e556c
commit b4b6dd3a75

View File

@ -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;