Change lastDeviceIdleTime to be per-device

Preparation work for per-device idle counters.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: James Jones <jajones@nvidia.com>
This commit is contained in:
Peter Hutterer 2012-03-12 13:51:02 +10:00
commit 6aef209ebc
11 changed files with 25 additions and 17 deletions

View file

@ -46,6 +46,7 @@ in this Software without prior written authorization from the X Consortium.
#include "cursorstr.h"
#include "colormapst.h"
#include "xace.h"
#include "inputstr.h"
#ifdef PANORAMIX
#include "panoramiX.h"
#include "panoramiXsrv.h"
@ -388,8 +389,10 @@ ScreenSaverFreeSuspend(pointer value, XID id)
if (screenIsSaved != SCREEN_SAVER_ON)
#endif
{
DeviceIntPtr dev;
UpdateCurrentTimeIf();
lastDeviceEventTime = currentTime;
nt_list_for_each_entry(dev, inputInfo.devices, next)
lastDeviceEventTime[dev->id] = currentTime;
SetScreenSaverTimer();
}
}
@ -672,7 +675,7 @@ ProcScreenSaverQueryInfo(ClientPtr client)
pPriv = GetScreenPrivate(pDraw->pScreen);
UpdateCurrentTime();
lastInput = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
lastInput = GetTimeInMillis() - lastDeviceEventTime[XIAllDevices].milliseconds;
rep.type = X_Reply;
rep.length = 0;

View file

@ -2599,7 +2599,7 @@ typedef struct {
static void
IdleTimeQueryValue(pointer pCounter, CARD64 * pValue_return)
{
CARD32 idle = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
CARD32 idle = GetTimeInMillis() - lastDeviceEventTime[XIAllDevices].milliseconds;
XSyncIntsToValue(pValue_return, idle, 0);
}