130quint32 QX11Info::appRootWindow(
int screen)
134 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
137 QScreen *scr = screen == -1 ? QGuiApplication::primaryScreen() : findScreenForVirtualDesktop(screen);
140 return static_cast<xcb_window_t>(
reinterpret_cast<quintptr>(native->nativeResourceForScreen(QByteArrayLiteral(
"rootwindow"), scr)));
175quint32 QX11Info::appTime()
179 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
182 QScreen* screen = QGuiApplication::primaryScreen();
183 return static_cast<xcb_timestamp_t>(
reinterpret_cast<quintptr>(native->nativeResourceForScreen(
"apptime", screen)));
191quint32 QX11Info::appUserTime()
195 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
198 QScreen* screen = QGuiApplication::primaryScreen();
199 return static_cast<xcb_timestamp_t>(
reinterpret_cast<quintptr>(native->nativeResourceForScreen(
"appusertime", screen)));
207void QX11Info::setAppTime(quint32 time)
211 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
214 typedef void (*SetAppTimeFunc)(QScreen *, xcb_timestamp_t);
215 QScreen* screen = QGuiApplication::primaryScreen();
216 SetAppTimeFunc func =
reinterpret_cast<SetAppTimeFunc>(
reinterpret_cast<
void *>(native->nativeResourceFunctionForScreen(
"setapptime")));
220 qWarning(
"Internal error: QPA plugin doesn't implement setAppTime");
228void QX11Info::setAppUserTime(quint32 time)
232 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
235 typedef void (*SetAppUserTimeFunc)(QScreen *, xcb_timestamp_t);
236 QScreen* screen = QGuiApplication::primaryScreen();
237 SetAppUserTimeFunc func =
reinterpret_cast<SetAppUserTimeFunc>(
reinterpret_cast<
void *>(native->nativeResourceFunctionForScreen(
"setappusertime")));
241 qWarning(
"Internal error: QPA plugin doesn't implement setAppUserTime");
250quint32 QX11Info::getTimestamp()
254 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
257 QScreen* screen = QGuiApplication::primaryScreen();
258 return static_cast<xcb_timestamp_t>(
reinterpret_cast<quintptr>(native->nativeResourceForScreen(
"gettimestamp", screen)));
328xcb_connection_t *QX11Info::connection()
332 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
336 void *connection = native->nativeResourceForIntegration(QByteArray(
"connection"));
337 return reinterpret_cast<xcb_connection_t *>(connection);
346bool QX11Info::isCompositingManagerRunning(
int screen)
350 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
354 QScreen *scr = screen == -1 ? QGuiApplication::primaryScreen() : findScreenForVirtualDesktop(screen);
356 qWarning() <<
"isCompositingManagerRunning: Could not find screen number" << screen;
360 return native->nativeResourceForScreen(QByteArray(
"compositingEnabled"), scr);
372qint32 QX11Info::generatePeekerId()
376 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
380 typedef qint32 (*GeneratePeekerIdFunc)(
void);
381 GeneratePeekerIdFunc generatepeekerid =
reinterpret_cast<GeneratePeekerIdFunc>(
382 reinterpret_cast<
void *>(native->nativeResourceFunctionForIntegration(
"generatepeekerid")));
383 if (!generatepeekerid) {
384 qWarning(
"Internal error: QPA plugin doesn't implement generatePeekerId");
388 return generatepeekerid();
399bool QX11Info::removePeekerId(qint32 peekerId)
403 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
407 typedef bool (*RemovePeekerIdFunc)(qint32);
408 RemovePeekerIdFunc removePeekerId =
reinterpret_cast<RemovePeekerIdFunc>(
409 reinterpret_cast<
void *>(native->nativeResourceFunctionForIntegration(
"removepeekerid")));
410 if (!removePeekerId) {
411 qWarning(
"Internal error: QPA plugin doesn't implement removePeekerId");
415 return removePeekerId(peekerId);
495bool QX11Info::peekEventQueue(PeekerCallback peeker,
void *peekerData, PeekOptions option,
498 if (!peeker || !
qApp)
500 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
504 typedef bool (*PeekEventQueueFunc)(PeekerCallback,
void *, PeekOptions, qint32);
505 PeekEventQueueFunc peekeventqueue =
reinterpret_cast<PeekEventQueueFunc>(
506 reinterpret_cast<
void *>(native->nativeResourceFunctionForIntegration(
"peekeventqueue")));
507 if (!peekeventqueue) {
508 qWarning(
"Internal error: QPA plugin doesn't implement peekEventQueue");
512 return peekeventqueue(peeker, peekerData, option, peekerId);