Merge pull request #1478 from aggroskater/reinstate_xss_idle_detection_linux

XSS Idle Detection Bugfix (XCloseDisplay)
This commit is contained in:
David Anderson 2016-01-27 20:50:17 -08:00
commit 5ade036b3a
1 changed files with 4 additions and 0 deletions

View File

@ -2090,6 +2090,7 @@ bool xss_idle(long idle_threshold) {
"[idle_detection] XScreenSaver extension not available for DISPLAY '%s'.", "[idle_detection] XScreenSaver extension not available for DISPLAY '%s'.",
it->c_str()); it->c_str());
} }
XCloseDisplay(disp);
continue; continue;
} }
@ -2098,6 +2099,9 @@ bool xss_idle(long idle_threshold) {
XScreenSaverQueryInfo(disp, DefaultRootWindow(disp), xssInfo); XScreenSaverQueryInfo(disp, DefaultRootWindow(disp), xssInfo);
idle_time = xssInfo->idle; idle_time = xssInfo->idle;
// Close the connection to the XServer
XCloseDisplay(disp);
// convert from milliseconds to seconds // convert from milliseconds to seconds
idle_time = idle_time / 1000; idle_time = idle_time / 1000;