diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-03-19 10:21:47 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-03-27 12:29:07 +0000 |
commit | 646d8d27552e548f37b329f3a67fd4bf46ee64f0 (patch) | |
tree | 22381f017c2890be51178a291c99cfffee85e346 /src/client/qwaylandxdgshell.cpp | |
parent | 83b67f717fe8ab5e95d9ca6e93cc139c8e0bd6c0 (diff) |
xdg-shell v5,v6 shell integrations: Fix crash when showing popups
If a popup was shown without any input events happening first, it would cause
nullptr dereferences in both xdg-shell v5 and v6.
Fixes crashes in:
- tst_QAccessibility::comboBoxTest
- tst_QAccessibility::menuTest
- tst_QWindow::touchInterruptedByPopup
- tst_QFocusEvent::checkReason_Popup
Task-number: QTBUG-67150
Change-Id: Ib3e06326f71e4ab5f74727cb4f79626a21c34d55
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 26a6372bb0c6528358e34f8175a14ff0be47fb12)
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/client/qwaylandxdgshell.cpp')
-rw-r--r-- | src/client/qwaylandxdgshell.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/client/qwaylandxdgshell.cpp b/src/client/qwaylandxdgshell.cpp index 6a9930608..c038c94a8 100644 --- a/src/client/qwaylandxdgshell.cpp +++ b/src/client/qwaylandxdgshell.cpp @@ -75,12 +75,11 @@ QWaylandXdgSurface *QWaylandXdgShell::createXdgSurface(QWaylandWindow *window) return new QWaylandXdgSurface(this, window); } -QWaylandXdgPopup *QWaylandXdgShell::createXdgPopup(QWaylandWindow *window) +QWaylandXdgPopup *QWaylandXdgShell::createXdgPopup(QWaylandWindow *window, QWaylandInputDevice *inputDevice) { QWaylandWindow *parentWindow = m_popups.empty() ? window->transientParent() : m_popups.last(); ::wl_surface *parentSurface = parentWindow->object(); - QWaylandInputDevice *inputDevice = window->display()->lastInputDevice(); if (m_popupSerial == 0) m_popupSerial = inputDevice->serial(); ::wl_seat *seat = inputDevice->wl_seat(); |