mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-07 23:02:23 +00:00
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:
parent
20cf0ef825
commit
6aef209ebc
11 changed files with 25 additions and 17 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue