Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1306)

Unified Diff: src/platform/power_manager/xidle.h

Issue 1035001: Fix off-by-one bug for the negative transition in XIdle::AddIdleTimeout, which (Closed)
Patch Set: Update to address Dan's comments Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/platform/power_manager/xidle.h
diff --git a/src/platform/power_manager/xidle.h b/src/platform/power_manager/xidle.h
index c59219c9cb2173de377669c20692efe5adfe03b6..b5e23b2957d63329381ed08d30e0524eb5290d8b 100644
--- a/src/platform/power_manager/xidle.h
+++ b/src/platform/power_manager/xidle.h
@@ -20,7 +20,8 @@ namespace power_manager {
//
// \example
// power_manager::XIdle idle;
-// idle.Init();
+// Display* display = XOpenDisplay(NULL);
+// idle.Init(display);
// idle.AddIdleTimeout(2000);
// idle.AddIdleTimeout(5000);
// int64 idle_time;
@@ -31,6 +32,7 @@ namespace power_manager {
// else
// std::cout << "User is active\n";
// }
+// XCloseDisplay(display);
// \end_example
class XIdle {
@@ -38,9 +40,9 @@ class XIdle {
XIdle();
~XIdle();
- // Connect to the X server and initialize the object.
+ // Initialize the object with the given X connection.
// On success, return true; otherwise return false.
- bool Init();
+ bool Init(Display* display);
// Add a timeout value. If the user exceeds this timeout value,
// the Monitor function will return and notify us. If there are

Powered by Google App Engine
This is Rietveld 408576698