summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp14
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h4
2 files changed, 16 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index 72299d5a9a..aeda1e11d1 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -80,7 +80,7 @@ static int resourceType(const QByteArray &key)
QByteArrayLiteral("glxcontext"), QByteArrayLiteral("apptime"),
QByteArrayLiteral("appusertime"), QByteArrayLiteral("hintstyle"),
QByteArrayLiteral("startupid"), QByteArrayLiteral("traywindow"),
- QByteArrayLiteral("gettimestamp")
+ QByteArrayLiteral("gettimestamp"), QByteArrayLiteral("x11screen")
};
const QByteArray *end = names + sizeof(names) / sizeof(names[0]);
const QByteArray *result = std::find(names, end, key);
@@ -139,6 +139,9 @@ void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resour
case StartupId:
result = startupId();
break;
+ case X11Screen:
+ result = x11Screen();
+ break;
default:
break;
}
@@ -252,6 +255,15 @@ void *QXcbNativeInterface::startupId()
return 0;
}
+void *QXcbNativeInterface::x11Screen()
+{
+ QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration());
+ QXcbConnection *defaultConnection = integration->defaultConnection();
+ if (defaultConnection)
+ return reinterpret_cast<void *>(defaultConnection->primaryScreen());
+ return 0;
+}
+
void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time)
{
static_cast<QXcbScreen *>(screen->handle())->connection()->setTime(time);
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index 86b94e62e4..aec78087f5 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -70,7 +70,8 @@ public:
ScreenHintStyle,
StartupId,
TrayWindow,
- GetTimestamp
+ GetTimestamp,
+ X11Screen
};
QXcbNativeInterface();
@@ -94,6 +95,7 @@ public:
void *appUserTime(const QXcbScreen *screen);
void *getTimestamp(const QXcbScreen *screen);
void *startupId();
+ void *x11Screen();
static void setAppTime(QScreen *screen, xcb_timestamp_t time);
static void setAppUserTime(QScreen *screen, xcb_timestamp_t time);
static void *eglContextForContext(QOpenGLContext *context);