summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/client/qwaylandxdgshell.cpp3
-rw-r--r--src/client/qwaylandxdgshell_p.h2
-rw-r--r--src/client/qwaylandxdgshellintegration.cpp5
-rw-r--r--src/client/qwaylandxdgshellv6.cpp5
4 files changed, 8 insertions, 7 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();
diff --git a/src/client/qwaylandxdgshell_p.h b/src/client/qwaylandxdgshell_p.h
index f462f2828..646612559 100644
--- a/src/client/qwaylandxdgshell_p.h
+++ b/src/client/qwaylandxdgshell_p.h
@@ -79,7 +79,7 @@ public:
virtual ~QWaylandXdgShell();
QWaylandXdgSurface *createXdgSurface(QWaylandWindow *window);
- QWaylandXdgPopup *createXdgPopup(QWaylandWindow *window);
+ QWaylandXdgPopup *createXdgPopup(QWaylandWindow *window, QWaylandInputDevice *inputDevice);
private:
void xdg_shell_ping(uint32_t serial) override;
diff --git a/src/client/qwaylandxdgshellintegration.cpp b/src/client/qwaylandxdgshellintegration.cpp
index 04b8e8048..dc5509ea2 100644
--- a/src/client/qwaylandxdgshellintegration.cpp
+++ b/src/client/qwaylandxdgshellintegration.cpp
@@ -75,8 +75,9 @@ bool QWaylandXdgShellIntegration::initialize(QWaylandDisplay *display)
QWaylandShellSurface *QWaylandXdgShellIntegration::createShellSurface(QWaylandWindow *window)
{
- if (window->window()->type() == Qt::WindowType::Popup)
- return m_xdgShell->createXdgPopup(window);
+ QWaylandInputDevice *inputDevice = window->display()->lastInputDevice();
+ if (window->window()->type() == Qt::WindowType::Popup && inputDevice)
+ return m_xdgShell->createXdgPopup(window, inputDevice);
else
return m_xdgShell->createXdgSurface(window);
}
diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/client/qwaylandxdgshellv6.cpp
index 7473174d1..a8c253b8f 100644
--- a/src/client/qwaylandxdgshellv6.cpp
+++ b/src/client/qwaylandxdgshellv6.cpp
@@ -165,8 +165,9 @@ void QWaylandXdgSurfaceV6::setAppId(const QString &appId)
void QWaylandXdgSurfaceV6::setType(Qt::WindowType type, QWaylandWindow *transientParent)
{
- if ((type == Qt::Popup || type == Qt::ToolTip) && transientParent) {
- setPopup(transientParent, m_window->display()->lastInputDevice(), m_window->display()->lastInputSerial(), type == Qt::Popup);
+ QWaylandDisplay *display = m_window->display();
+ if ((type == Qt::Popup || type == Qt::ToolTip) && transientParent && display->lastInputDevice()) {
+ setPopup(transientParent, display->lastInputDevice(), display->lastInputSerial(), type == Qt::Popup);
} else {
setToplevel();
if (transientParent) {