summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-12-17 23:35:56 +0100
committerDavid Faure (KDE) <faure@kde.org>2012-12-18 13:02:37 +0100
commit11d677618ddf86851d4ee071bd29454dcaff6be7 (patch)
treebed4eb80752047fcdc07afc0f5f5d1abde9fb5e3
parent7fab677324b13e254e3938c8fc70c8da181c1066 (diff)
downloadqtx11extras-11d677618ddf86851d4ee071bd29454dcaff6be7.tar.gz
Port to the version of the appTime/appUserTime that got merged in.
(60bd2156f81 in qtbase) Change-Id: I95fabfba2d47e4d5e65df03cb95b0fe1fb69d6a7 Reviewed-by: Richard J. Moore <rich@kde.org>
-rw-r--r--src/x11support/qx11info_x11.cpp20
1 files 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<xcb_timestamp_t>(reinterpret_cast<quintptr>(native->nativeResourceForIntegration("apptime")));
+ QScreen* screen = QGuiApplication::primaryScreen();
+ return static_cast<xcb_timestamp_t>(reinterpret_cast<quintptr>(native->nativeResourceForScreen("apptime", screen)));
}
/*!
@@ -200,7 +201,8 @@ unsigned long QX11Info::appUserTime()
if (!qApp)
return 0;
QPlatformNativeInterface *native = qApp->platformNativeInterface();
- return static_cast<xcb_timestamp_t>(reinterpret_cast<quintptr>(native->nativeResourceForIntegration("appusertime")));
+ QScreen* screen = QGuiApplication::primaryScreen();
+ return static_cast<xcb_timestamp_t>(reinterpret_cast<quintptr>(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<SetAppTimeFunc>(native->nativeResourceFunctionForIntegration("setapptime"));
+ typedef void (*SetAppTimeFunc)(QScreen *, xcb_timestamp_t);
+ QScreen* screen = QGuiApplication::primaryScreen();
+ SetAppTimeFunc func = reinterpret_cast<SetAppTimeFunc>(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<SetAppUserTimeFunc>(native->nativeResourceFunctionForIntegration("setappusertime"));
+ typedef void (*SetAppUserTimeFunc)(QScreen *, xcb_timestamp_t);
+ QScreen* screen = QGuiApplication::primaryScreen();
+ SetAppUserTimeFunc func = reinterpret_cast<SetAppUserTimeFunc>(native->nativeResourceFunctionForScreen("setappusertime"));
if (func)
- func(time);
+ func(screen, time);
else
qWarning("Internal error: QPA plugin doesn't implement setAppUserTime");
}