summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-11 15:45:32 +0100
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-27 15:16:55 +0100
commit061e29274712f51d982eb29286229f0fca6e464d (patch)
tree688770b7eaddea18412deaf522d6b84b02982e0f
parentcd64af4b6d469169b0fe9f26f9fca247cda84a55 (diff)
downloadqtwayland-061e29274712f51d982eb29286229f0fca6e464d.tar.gz
Client: Workaround for QPlatformWindow::setVisible(true) being called twice
Fixes a crash. Otherwise we created two shell surface objects in some cases. Change-Id: Ieded56261061da6acf27ccabba81c8f578ca1596 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
-rw-r--r--src/client/qwaylandwindow.cpp5
-rw-r--r--src/client/qwaylandwindow_p.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index c8a01dc2..3a335563 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -414,6 +414,11 @@ QPlatformScreen *QWaylandWindow::calculateScreenFromSurfaceEvents() const
void QWaylandWindow::setVisible(bool visible)
{
+ // Workaround for issue where setVisible may be called with the same value twice
+ if (lastVisible == visible)
+ return;
+ lastVisible = visible;
+
if (visible) {
if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip)
activePopups << this;
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index 823e4a97..352df89d 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -270,6 +270,7 @@ private:
void handleScreensChanged();
bool mInResizeFromApplyConfigure = false;
+ bool lastVisible = false;
QRect mLastExposeGeometry;
static const wl_callback_listener callbackListener;