From 223fc10cdee20ecb97337f0a3e6e3b9cc10fff75 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Sun, 17 Aug 2014 13:58:02 +0200 Subject: [PATCH] QWaylandWindow: Add a missing shell surface null check. Caught by tst_QWidget::mapFromAndTo. Change-Id: I36e08ebfa3bae1ac8667ee828b1762867d71c66d Reviewed-by: Giulio Camuffo --- .../platforms/wayland/qwaylandwindow.cpp | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 6ebe610abef..1e40998a60f 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -657,18 +657,21 @@ bool QWaylandWindow::setWindowStateInternal(Qt::WindowState state) // here. We use then this mState variable. mState = state; createDecoration(); - switch (state) { - case Qt::WindowFullScreen: - mShellSurface->setFullscreen(); - break; - case Qt::WindowMaximized: - mShellSurface->setMaximized(); - break; - case Qt::WindowMinimized: - mShellSurface->setMinimized(); - break; - default: - mShellSurface->setNormal(); + + if (mShellSurface) { + switch (state) { + case Qt::WindowFullScreen: + mShellSurface->setFullscreen(); + break; + case Qt::WindowMaximized: + mShellSurface->setMaximized(); + break; + case Qt::WindowMinimized: + mShellSurface->setMinimized(); + break; + default: + mShellSurface->setNormal(); + } } QWindowSystemInterface::handleWindowStateChanged(window(), mState);