When resetting device idle time, reset XIAll(Master)Devices too (#56649)

When the screen saver is forcibly deactivated, the idle time counter is
reset for all devices but not for the fake XIAllDevices and
XIAllMasterDevices. XScreenSaverQueryInfo uses XIAlldevices to fill the
"idle" field, thus returning the wrong value.

Regression introduced in
commit 6aef209ebc
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Mar 12 13:51:02 2012 +1000

    Change lastDeviceIdleTime to be per-device

X.Org Bug 56649 <http://bugs.freedesktop.org/show_bug.cgi?id=56649>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Giacomo Perale <ghepeu@virgilio.it>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Peter Hutterer 2012-11-15 14:00:57 +10:00
parent a51b2c3913
commit 2dc6d92284
2 changed files with 4 additions and 0 deletions

View File

@ -393,6 +393,8 @@ ScreenSaverFreeSuspend(pointer value, XID id)
UpdateCurrentTimeIf(); UpdateCurrentTimeIf();
nt_list_for_each_entry(dev, inputInfo.devices, next) nt_list_for_each_entry(dev, inputInfo.devices, next)
lastDeviceEventTime[dev->id] = currentTime; lastDeviceEventTime[dev->id] = currentTime;
lastDeviceEventTime[XIAllDevices] = currentTime;
lastDeviceEventTime[XIAllMasterDevices] = currentTime;
SetScreenSaverTimer(); SetScreenSaverTimer();
} }
} }

View File

@ -3095,6 +3095,8 @@ dixSaveScreens(ClientPtr client, int on, int mode)
UpdateCurrentTimeIf(); UpdateCurrentTimeIf();
nt_list_for_each_entry(dev, inputInfo.devices, next) nt_list_for_each_entry(dev, inputInfo.devices, next)
lastDeviceEventTime[dev->id] = currentTime; lastDeviceEventTime[dev->id] = currentTime;
lastDeviceEventTime[XIAllDevices] = currentTime;
lastDeviceEventTime[XIAllMasterDevices] = currentTime;
} }
SetScreenSaverTimer(); SetScreenSaverTimer();
} }