summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandwindow.cpp
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-02-04 16:34:52 +0100
committerJohan Helsing <johan.helsing@qt.io>2019-02-12 10:27:57 +0000
commit4b58ff21f4a3c629867064289b6c778bbb57f95a (patch)
tree4694a2cd8eaa4035ad7a9c2f716195845ca12479 /src/client/qwaylandwindow.cpp
parent2824a71e5c28ec1843edc056f2c17c6274378f1d (diff)
Client xdg-shell: Fix crash when switching popups
The call to flushWindowSystemEvents() sometimes caused new popups to be shown in the middle of hiding another. I.e. if multiple events show and hide surfaces, they would be shown/hidden in opposite order of their corresponding events. QMenus sometimes suffered from this (can be seen with the qopenglwidget example from qtbase). When the flush was added 5 years ago in 50f43a0c5, it was to "reduce the chances of seeing a bad frame". I don't see any rendering artifacts, though, and I can't find any bug report on it. So let's hope it's safe to remove the hack. [ChangeLog][QPA plugin] Fixed a crash that sometimes happened when switching popups. Also adds more info to the workaround warning message that appears when a popup grab is attempted and there already is another grabbing popup that is not the parent. Fixes: QTBUG-73524 Change-Id: Ibfcbb48c4bbe295c2be1a30add2d7e05cad398c5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r--src/client/qwaylandwindow.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 282179efb..c46c49813 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -395,14 +395,9 @@ void QWaylandWindow::setVisible(bool visible)
// QWaylandShmBackingStore::beginPaint().
} else {
sendExposeEvent(QRect());
- // when flushing the event queue, it could contain a close event, in which
- // case 'this' will be deleted. When that happens, we must abort right away.
- QPointer<QWaylandWindow> deleteGuard(this);
- QWindowSystemInterface::flushWindowSystemEvents();
- if (!deleteGuard.isNull() && window()->type() == Qt::Popup)
+ if (window()->type() == Qt::Popup)
closePopups(this);
- if (!deleteGuard.isNull())
- reset();
+ reset();
}
}