From 11d677618ddf86851d4ee071bd29454dcaff6be7 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 17 Dec 2012 23:35:56 +0100 Subject: Port to the version of the appTime/appUserTime that got merged in. (60bd2156f81 in qtbase) Change-Id: I95fabfba2d47e4d5e65df03cb95b0fe1fb69d6a7 Reviewed-by: Richard J. Moore --- src/x11support/qx11info_x11.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/x11support/qx11info_x11.cpp b/src/x11support/qx11info_x11.cpp index 4790c3f..db3c0a1 100644 --- a/src/x11support/qx11info_x11.cpp +++ b/src/x11support/qx11info_x11.cpp @@ -187,7 +187,8 @@ unsigned long QX11Info::appTime() if (!qApp) return 0; QPlatformNativeInterface *native = qApp->platformNativeInterface(); - return static_cast(reinterpret_cast(native->nativeResourceForIntegration("apptime"))); + QScreen* screen = QGuiApplication::primaryScreen(); + return static_cast(reinterpret_cast(native->nativeResourceForScreen("apptime", screen))); } /*! @@ -200,7 +201,8 @@ unsigned long QX11Info::appUserTime() if (!qApp) return 0; QPlatformNativeInterface *native = qApp->platformNativeInterface(); - return static_cast(reinterpret_cast(native->nativeResourceForIntegration("appusertime"))); + QScreen* screen = QGuiApplication::primaryScreen(); + return static_cast(reinterpret_cast(native->nativeResourceForScreen("appusertime", screen))); } /*! @@ -213,10 +215,11 @@ void QX11Info::setAppTime(unsigned long time) if (!qApp) return; QPlatformNativeInterface *native = qApp->platformNativeInterface(); - typedef void (*SetAppTimeFunc)(xcb_timestamp_t); - SetAppTimeFunc func = reinterpret_cast(native->nativeResourceFunctionForIntegration("setapptime")); + typedef void (*SetAppTimeFunc)(QScreen *, xcb_timestamp_t); + QScreen* screen = QGuiApplication::primaryScreen(); + SetAppTimeFunc func = reinterpret_cast(native->nativeResourceFunctionForScreen("setapptime")); if (func) - func(time); + func(screen, time); else qWarning("Internal error: QPA plugin doesn't implement setAppTime"); } @@ -231,10 +234,11 @@ void QX11Info::setAppUserTime(unsigned long time) if (!qApp) return; QPlatformNativeInterface *native = qApp->platformNativeInterface(); - typedef void (*SetAppUserTimeFunc)(xcb_timestamp_t); - SetAppUserTimeFunc func = reinterpret_cast(native->nativeResourceFunctionForIntegration("setappusertime")); + typedef void (*SetAppUserTimeFunc)(QScreen *, xcb_timestamp_t); + QScreen* screen = QGuiApplication::primaryScreen(); + SetAppUserTimeFunc func = reinterpret_cast(native->nativeResourceFunctionForScreen("setappusertime")); if (func) - func(time); + func(screen, time); else qWarning("Internal error: QPA plugin doesn't implement setAppUserTime"); } -- cgit v1.2.1