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>
This commit is contained in:
Johan Klokkhammer Helsing 2020-02-11 15:45:32 +01:00
parent a23d0f4587
commit 75fd4b4669
2 changed files with 6 additions and 0 deletions

View File

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

View File

@ -270,6 +270,7 @@ private:
void handleScreensChanged();
bool mInResizeFromApplyConfigure = false;
bool lastVisible = false;
QRect mLastExposeGeometry;
static const wl_callback_listener callbackListener;