summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-05-09 00:44:24 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-05-13 14:21:22 +0200
commitb5552bab40f2e165cf7196993ffc83785f4d8264 (patch)
tree5ca863fc90caacebd7bd5ebd2464d4b18efdd0dc /src/platformsupport
parent9cfdd66b6452704349b5f986f31b7f1f03748cb5 (diff)
parent01ce104a3ee3c8af68f6694840931661666984ab (diff)
Merge remote-tracking branch 'origin/stable' into dev
Manually changed enum to LibGL in src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: If34ee6cce3d1d51fb4bb1fdfa59c30389ea0d207
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcursor.cpp27
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcursor_p.h19
2 files changed, 43 insertions, 3 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor.cpp b/src/platformsupport/eglconvenience/qeglplatformcursor.cpp
index 70e7c4e4db..e99581183e 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcursor.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcursor.cpp
@@ -69,7 +69,8 @@ QEGLPlatformCursor::QEGLPlatformCursor(QPlatformScreen *screen)
m_vertexCoordEntry(0),
m_textureCoordEntry(0),
m_textureEntry(0),
- m_deviceListener(0)
+ m_deviceListener(0),
+ m_updater(screen)
{
QByteArray hideCursorVal = qgetenv("QT_QPA_EGLFS_HIDECURSOR");
if (!hideCursorVal.isEmpty())
@@ -270,12 +271,32 @@ bool QEGLPlatformCursor::setCurrentCursor(QCursor *cursor)
}
#endif
-void QEGLPlatformCursor::update(const QRegion &rgn)
+void QEGLPlatformCursorUpdater::update(const QPoint &pos, const QRegion &rgn)
{
- QWindowSystemInterface::handleExposeEvent(m_screen->topLevelAt(m_cursor.pos), rgn);
+ m_active = false;
+ QWindowSystemInterface::handleExposeEvent(m_screen->topLevelAt(pos), rgn);
QWindowSystemInterface::flushWindowSystemEvents();
}
+void QEGLPlatformCursorUpdater::scheduleUpdate(const QPoint &pos, const QRegion &rgn)
+{
+ if (m_active)
+ return;
+
+ m_active = true;
+
+ // Must not flush the window system events directly from here since we are likely to
+ // be a called directly from QGuiApplication's processMouseEvents. Flushing events
+ // could cause reentering by dispatching more queued mouse events.
+ QMetaObject::invokeMethod(this, "update", Qt::QueuedConnection,
+ Q_ARG(QPoint, pos), Q_ARG(QRegion, rgn));
+}
+
+void QEGLPlatformCursor::update(const QRegion &rgn)
+{
+ m_updater.scheduleUpdate(m_cursor.pos, rgn);
+}
+
QRect QEGLPlatformCursor::cursorRect() const
{
return QRect(m_cursor.pos - m_cursor.hotSpot, m_cursor.size);
diff --git a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
index c9ff9a1198..6f4216874a 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcursor_p.h
@@ -68,6 +68,24 @@ private:
int m_mouseCount;
};
+class QEGLPlatformCursorUpdater : public QObject
+{
+ Q_OBJECT
+
+public:
+ QEGLPlatformCursorUpdater(QPlatformScreen *screen)
+ : m_screen(screen), m_active(false) { }
+
+ void scheduleUpdate(const QPoint &pos, const QRegion &rgn);
+
+private slots:
+ void update(const QPoint &pos, const QRegion &rgn);
+
+private:
+ QPlatformScreen *m_screen;
+ bool m_active;
+};
+
class QEGLPlatformCursor : public QPlatformCursor
{
public:
@@ -130,6 +148,7 @@ private:
int m_textureCoordEntry;
int m_textureEntry;
QEGLPlatformCursorDeviceListener *m_deviceListener;
+ QEGLPlatformCursorUpdater m_updater;
};
QT_END_NAMESPACE