diff options
author | Jan Kundrát <jkt@kde.org> | 2015-03-12 17:00:44 +0100 |
---|---|---|
committer | Jan Kundrát <jkt@kde.org> | 2015-03-12 17:11:17 +0000 |
commit | 5585d66ff01904232705e96d7d195e6dc51cb23a (patch) | |
tree | 0514a299d1230c85820e7da91c7b38e5829bf937 /src | |
parent | 4de80f30ee03ff310584e142dfde1858719e0b67 (diff) |
xcb: Add support for obtaining default xcb connection
This is needed by qtx11extras now that we can meet a nullptr QScreen.
Change-Id: I755523cbbbbe188f454bd518d2d86a981542458f
Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 9 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 3a4539c5e6..bfba7f2b6a 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -233,6 +233,9 @@ void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resour case Display: result = display(); break; + case Connection: + result = connection(); + break; default: break; } @@ -454,6 +457,12 @@ void *QXcbNativeInterface::display() return Q_NULLPTR; } +void *QXcbNativeInterface::connection() +{ + QXcbIntegration *integration = QXcbIntegration::instance(); + return integration->defaultConnection()->xcb_connection(); +} + void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time) { if (screen) { diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h index 64da388258..721c6f4b1d 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.h +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h @@ -98,6 +98,7 @@ public: void *x11Screen(); void *rootWindow(); void *display(); + void *connection(); static void setStartupId(const char *); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); |