129quint32 QX11Info::appRootWindow(
int screen)
133 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
136 QScreen *scr = screen == -1 ? QGuiApplication::primaryScreen() : findScreenForVirtualDesktop(screen);
139 return static_cast<xcb_window_t>(
reinterpret_cast<quintptr>(native->nativeResourceForScreen(QByteArrayLiteral(
"rootwindow"), scr)));
174quint32 QX11Info::appTime()
178 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
181 QScreen* screen = QGuiApplication::primaryScreen();
182 return static_cast<xcb_timestamp_t>(
reinterpret_cast<quintptr>(native->nativeResourceForScreen(
"apptime", screen)));
190quint32 QX11Info::appUserTime()
194 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
197 QScreen* screen = QGuiApplication::primaryScreen();
198 return static_cast<xcb_timestamp_t>(
reinterpret_cast<quintptr>(native->nativeResourceForScreen(
"appusertime", screen)));
206void QX11Info::setAppTime(quint32 time)
210 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
213 typedef void (*SetAppTimeFunc)(QScreen *, xcb_timestamp_t);
214 QScreen* screen = QGuiApplication::primaryScreen();
215 SetAppTimeFunc func =
reinterpret_cast<SetAppTimeFunc>(
reinterpret_cast<
void *>(native->nativeResourceFunctionForScreen(
"setapptime")));
219 qWarning(
"Internal error: QPA plugin doesn't implement setAppTime");
227void QX11Info::setAppUserTime(quint32 time)
231 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
234 typedef void (*SetAppUserTimeFunc)(QScreen *, xcb_timestamp_t);
235 QScreen* screen = QGuiApplication::primaryScreen();
236 SetAppUserTimeFunc func =
reinterpret_cast<SetAppUserTimeFunc>(
reinterpret_cast<
void *>(native->nativeResourceFunctionForScreen(
"setappusertime")));
240 qWarning(
"Internal error: QPA plugin doesn't implement setAppUserTime");
249quint32 QX11Info::getTimestamp()
253 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
256 QScreen* screen = QGuiApplication::primaryScreen();
257 return static_cast<xcb_timestamp_t>(
reinterpret_cast<quintptr>(native->nativeResourceForScreen(
"gettimestamp", screen)));
327xcb_connection_t *QX11Info::connection()
331 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
335 void *connection = native->nativeResourceForIntegration(QByteArray(
"connection"));
336 return reinterpret_cast<xcb_connection_t *>(connection);
345bool QX11Info::isCompositingManagerRunning(
int screen)
349 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
353 QScreen *scr = screen == -1 ? QGuiApplication::primaryScreen() : findScreenForVirtualDesktop(screen);
355 qWarning() <<
"isCompositingManagerRunning: Could not find screen number" << screen;
359 return native->nativeResourceForScreen(QByteArray(
"compositingEnabled"), scr);
371qint32 QX11Info::generatePeekerId()
375 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
379 typedef qint32 (*GeneratePeekerIdFunc)(
void);
380 GeneratePeekerIdFunc generatepeekerid =
reinterpret_cast<GeneratePeekerIdFunc>(
381 reinterpret_cast<
void *>(native->nativeResourceFunctionForIntegration(
"generatepeekerid")));
382 if (!generatepeekerid) {
383 qWarning(
"Internal error: QPA plugin doesn't implement generatePeekerId");
387 return generatepeekerid();
398bool QX11Info::removePeekerId(qint32 peekerId)
402 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
406 typedef bool (*RemovePeekerIdFunc)(qint32);
407 RemovePeekerIdFunc removePeekerId =
reinterpret_cast<RemovePeekerIdFunc>(
408 reinterpret_cast<
void *>(native->nativeResourceFunctionForIntegration(
"removepeekerid")));
409 if (!removePeekerId) {
410 qWarning(
"Internal error: QPA plugin doesn't implement removePeekerId");
414 return removePeekerId(peekerId);
494bool QX11Info::peekEventQueue(PeekerCallback peeker,
void *peekerData, PeekOptions option,
497 if (!peeker || !
qApp)
499 QPlatformNativeInterface *native =
qApp->platformNativeInterface();
503 typedef bool (*PeekEventQueueFunc)(PeekerCallback,
void *, PeekOptions, qint32);
504 PeekEventQueueFunc peekeventqueue =
reinterpret_cast<PeekEventQueueFunc>(
505 reinterpret_cast<
void *>(native->nativeResourceFunctionForIntegration(
"peekeventqueue")));
506 if (!peekeventqueue) {
507 qWarning(
"Internal error: QPA plugin doesn't implement peekEventQueue");
511 return peekeventqueue(peeker, peekerData, option, peekerId);