summaryrefslogtreecommitdiff
path: root/dix/devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/devices.c')
-rw-r--r--dix/devices.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 012550443..600f8b738 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -84,6 +84,7 @@ SOFTWARE.
#include "enterleave.h" /* for EnterWindow() */
#include "xserver-properties.h"
#include "xichangehierarchy.h" /* For XISendDeviceHierarchyEvent */
+#include "syncsrv.h"
/** @file
* This file handles input device-related stuff.
@@ -406,9 +407,13 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
RecalculateMasterButtons(dev);
+ /* initialise an idle timer for this device*/
+ dev->idle_counter = SyncInitDeviceIdleTime(dev);
+
return TRUE;
}
+
/**
* Switch a device off through the driver and push it onto the off_devices
* list. A device will not send events while disabled. All clients are
@@ -432,6 +437,9 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
if (*prev != dev)
return FALSE;
+ SyncRemoveDeviceIdleTime(dev->idle_counter);
+ dev->idle_counter = NULL;
+
/* float attached devices */
if (IsMaster(dev)) {
for (other = inputInfo.devices; other; other = other->next) {