diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-04-24 10:14:11 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-04-24 10:14:11 +0300 |
commit | 9e0ec09db176f688cddea0607296322e9fb823e9 (patch) | |
tree | cafbf3541a4f697aaf3b26c730026064adfbeea9 | |
parent | 8f56244ea77a54da7593a7d65a4e5470d34e905e (diff) | |
parent | af9964b88b79ee3716a88beb2a5fb3243ded0139 (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.10' into tqtc/lts-5.15-opensourcev5.15.10-lts-lgpl
Change-Id: Ic1214ad103c75fa462ced678ca0acab365e7ed0a
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 27 | ||||
-rw-r--r-- | tests/auto/client/shared/corecompositor.cpp | 1 |
3 files changed, 29 insertions, 1 deletions
diff --git a/.qmake.conf b/.qmake.conf index e1cc185f3..7a4e9fbfa 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -4,4 +4,4 @@ DEFINES += QT_NO_FOREACH DEFINES += QT_NO_JAVA_STYLE_ITERATORS DEFINES += QT_NO_LINKED_LIST -MODULE_VERSION = 5.15.9 +MODULE_VERSION = 5.15.10 diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index f50e1c0e8..fa9c01aa5 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -220,6 +220,16 @@ QWaylandXdgSurface::Popup::~Popup() auto *shell = m_xdgSurface->m_shell; Q_ASSERT(shell->m_topmostGrabbingPopup == this); shell->m_topmostGrabbingPopup = m_parent->m_popup; + m_grabbing = false; + + // Synthesize Qt enter/leave events for popup + QWindow *leave = nullptr; + if (m_xdgSurface && m_xdgSurface->window()) + leave = m_xdgSurface->window()->window(); + QWindowSystemInterface::handleLeaveEvent(leave); + + if (QWindow *enter = QGuiApplication::topLevelAt(QCursor::pos())) + QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos()); } } @@ -441,6 +451,23 @@ void QWaylandXdgSurface::setGrabPopup(QWaylandWindow *parent, QWaylandInputDevic } setPopup(parent); m_popup->grab(device, serial); + + // Synthesize Qt enter/leave events for popup + if (!parent) + return; + QWindow *current = QGuiApplication::topLevelAt(QCursor::pos()); + QWindow *leave = parent->window(); + if (current != leave) + return; + + QWindowSystemInterface::handleLeaveEvent(leave); + + QWindow *enter = nullptr; + if (m_popup && m_popup->m_xdgSurface && m_popup->m_xdgSurface->window()) + enter = m_popup->m_xdgSurface->window()->window(); + + if (enter) + QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(QCursor::pos()), QCursor::pos()); } void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) diff --git a/tests/auto/client/shared/corecompositor.cpp b/tests/auto/client/shared/corecompositor.cpp index 5c6c83baa..fa9b7662a 100644 --- a/tests/auto/client/shared/corecompositor.cpp +++ b/tests/auto/client/shared/corecompositor.cpp @@ -27,6 +27,7 @@ ****************************************************************************/ #include "corecompositor.h" +#include <thread> namespace MockCompositor { |