diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h b/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h index b293651ce71..7df1aa3c2c8 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h +++ b/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h @@ -52,7 +52,9 @@ // #include "qeglfsglobal_p.h" +#include #include +#include #include #include #include @@ -106,6 +108,9 @@ public: QFbVtHandler *vtHandler() { return m_vtHandler.data(); } + QPointer pointerWindow() { return m_pointerWindow; } + void setPointerWindow(QWindow *pointerWindow) { m_pointerWindow = pointerWindow; } + private: EGLNativeDisplayType nativeDisplay() const; void createInputHandlers(); @@ -118,6 +123,7 @@ private: QScopedPointer m_services; QScopedPointer m_vtHandler; QEvdevKeyboardManager *m_kbdMgr; + QPointer m_pointerWindow; bool m_disableInputHandlers; }; diff --git a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp index 8a8e8cd5634..1d3e5ca6afe 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include #ifndef QT_NO_OPENGL @@ -149,6 +150,7 @@ void QEglFSScreen::handleCursorMove(const QPoint &pos) #ifndef QT_NO_OPENGL const QOpenGLCompositor *compositor = QOpenGLCompositor::instance(); const QList windows = compositor->windows(); + QEglFSIntegration *platformIntegration = static_cast(QGuiApplicationPrivate::platformIntegration()); // Generate enter and leave events like a real windowing system would do. if (windows.isEmpty()) @@ -157,8 +159,8 @@ void QEglFSScreen::handleCursorMove(const QPoint &pos) // First window is always fullscreen. if (windows.count() == 1) { QWindow *window = windows[0]->sourceWindow(); - if (m_pointerWindow != window) { - m_pointerWindow = window; + if (platformIntegration->pointerWindow() != window) { + platformIntegration->setPointerWindow(window); QWindowSystemInterface::handleEnterEvent(window, window->mapFromGlobal(pos), pos); } return; @@ -169,17 +171,22 @@ void QEglFSScreen::handleCursorMove(const QPoint &pos) QWindow *window = windows[i]->sourceWindow(); const QRect geom = window->geometry(); if (geom.contains(pos)) { - if (m_pointerWindow != window) { - leave = m_pointerWindow; - m_pointerWindow = window; + if (platformIntegration->pointerWindow() != window) { + leave = platformIntegration->pointerWindow(); + platformIntegration->setPointerWindow(window); enter = window; } break; } } - if (enter && leave) + if (enter && leave) { QWindowSystemInterface::handleEnterLeaveEvent(enter, leave, enter->mapFromGlobal(pos), pos); + } else if (enter) { + QWindowSystemInterface::handleEnterEvent(enter, enter->mapFromGlobal(pos), pos); + } else if (leave) { + QWindowSystemInterface::handleLeaveEvent(leave); + } #else Q_UNUSED(pos); #endif diff --git a/src/plugins/platforms/eglfs/api/qeglfsscreen_p.h b/src/plugins/platforms/eglfs/api/qeglfsscreen_p.h index bea7b4c8ef0..cf4a7afc33a 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsscreen_p.h +++ b/src/plugins/platforms/eglfs/api/qeglfsscreen_p.h @@ -94,7 +94,6 @@ private: void setPrimarySurface(EGLSurface surface); EGLDisplay m_dpy; - QPointer m_pointerWindow; EGLSurface m_surface; QPlatformCursor *m_cursor;