diff options
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbnativeinterface.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index dfb0a125e2..1403cee622 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -33,6 +33,7 @@ #include "qxcbnativeinterface.h" +#include "qxcbcursor.h" #include "qxcbscreen.h" #include "qxcbwindow.h" #include "qxcbintegration.h" @@ -91,18 +92,6 @@ QXcbNativeInterface::QXcbNativeInterface() : { } -void QXcbNativeInterface::beep() // For QApplication::beep() -{ - QScreen *priScreen = QGuiApplication::primaryScreen(); - if (!priScreen) - return; - QPlatformScreen *screen = priScreen->handle(); - if (!screen) - return; - xcb_connection_t *connection = static_cast<QXcbScreen *>(screen)->xcb_connection(); - xcb_bell(connection, 0); -} - static inline QXcbSystemTrayTracker *systemTrayTracker(const QScreen *s) { if (!s) @@ -288,6 +277,20 @@ void *QXcbNativeInterface::nativeResourceForBackingStore(const QByteArray &resou return result; } +#ifndef QT_NO_CURSOR +void *QXcbNativeInterface::nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) +{ + if (resource == QByteArrayLiteral("xcbcursor")) { + if (const QScreen *primaryScreen = QGuiApplication::primaryScreen()) { + if (const QPlatformCursor *pCursor= primaryScreen->handle()->cursor()) { + xcb_cursor_t xcbCursor = static_cast<const QXcbCursor *>(pCursor)->xcbCursor(cursor); + return reinterpret_cast<void *>(quintptr(xcbCursor)); + } + } + } + return Q_NULLPTR; +} +#endif // !QT_NO_CURSOR QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterface::nativeResourceFunctionForIntegration(const QByteArray &resource) { @@ -444,11 +447,15 @@ void *QXcbNativeInterface::atspiBus() QXcbConnection *defaultConnection = integration->defaultConnection(); if (defaultConnection) { xcb_atom_t atspiBusAtom = defaultConnection->internAtom("AT_SPI_BUS"); - xcb_get_property_cookie_t cookie = Q_XCB_CALL(xcb_get_property(defaultConnection->xcb_connection(), false, - defaultConnection->rootWindow(), - atspiBusAtom, - XCB_ATOM_STRING, 0, 128)); - xcb_get_property_reply_t *reply = Q_XCB_CALL(xcb_get_property_reply(defaultConnection->xcb_connection(), cookie, 0)); + xcb_get_property_cookie_t cookie = Q_XCB_CALL2(xcb_get_property( + defaultConnection->xcb_connection(), + false, defaultConnection->rootWindow(), + atspiBusAtom, XCB_ATOM_STRING, 0, 128), + defaultConnection); + xcb_get_property_reply_t *reply = Q_XCB_CALL2(xcb_get_property_reply( + defaultConnection->xcb_connection(), + cookie, 0), + defaultConnection); Q_ASSERT(!reply->bytes_after); char *data = (char *)xcb_get_property_value(reply); int length = xcb_get_property_value_length(reply); |