diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2017-08-04 12:10:12 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2017-08-11 13:06:38 +0000 |
commit | 255abc1e5a3397bf14e9854388881cd80f0bd2e3 (patch) | |
tree | c0702be550ffce279ae9af34970a904a2fdb3535 /src/plugins/platforms/xcb/qxcbnativeinterface.cpp | |
parent | a6c4d54eaf467e2db4eef83d737ffcbb263345d0 (diff) |
xcb: add support for peeking into the XCB event queue
This will be used by the Qt X11 Extras module.
Task-number: QTBUG-50358
Change-Id: Ie095cd211c393ea6d78660b4d53cac28b435a3b2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbnativeinterface.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 76ee8f3fb4..caa9499c45 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -83,7 +83,10 @@ static int resourceType(const QByteArray &key) QByteArrayLiteral("subpixeltype"), QByteArrayLiteral("antialiasingenabled"), QByteArrayLiteral("atspibus"), QByteArrayLiteral("compositingenabled"), - QByteArrayLiteral("vksurface") + QByteArrayLiteral("vksurface"), + QByteArrayLiteral("generatepeekerid"), + QByteArrayLiteral("removepeekerid"), + QByteArrayLiteral("peekeventqueue") }; const QByteArray *end = names + sizeof(names) / sizeof(names[0]); const QByteArray *result = std::find(names, end, key); @@ -304,6 +307,13 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterfa if (lowerCaseResource == "setstartupid") return NativeResourceForIntegrationFunction(setStartupId); + if (lowerCaseResource == "generatepeekerid") + return NativeResourceForIntegrationFunction(generatePeekerId); + if (lowerCaseResource == "removepeekerid") + return NativeResourceForIntegrationFunction(removePeekerId); + if (lowerCaseResource == "peekeventqueue") + return NativeResourceForIntegrationFunction(peekEventQueue); + return 0; } @@ -482,6 +492,25 @@ void QXcbNativeInterface::setAppUserTime(QScreen* screen, xcb_timestamp_t time) } } +qint32 QXcbNativeInterface::generatePeekerId() +{ + QXcbIntegration *integration = QXcbIntegration::instance(); + return integration->defaultConnection()->generatePeekerId(); +} + +bool QXcbNativeInterface::removePeekerId(qint32 peekerId) +{ + QXcbIntegration *integration = QXcbIntegration::instance(); + return integration->defaultConnection()->removePeekerId(peekerId); +} + +bool QXcbNativeInterface::peekEventQueue(QXcbConnection::PeekerCallback peeker, void *peekerData, + QXcbConnection::PeekOptions option, qint32 peekerId) +{ + QXcbIntegration *integration = QXcbIntegration::instance(); + return integration->defaultConnection()->peekEventQueue(peeker, peekerData, option, peekerId); +} + void QXcbNativeInterface::setStartupId(const char *data) { QByteArray startupId(data); |