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

Unified Diff: src/platform/power_manager/xidle-example.cc

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-example.cc
diff --git a/src/platform/power_manager/xidle-example.cc b/src/platform/power_manager/xidle-example.cc
index ca5e4b8256f361200097ceee10ce7f4e891b7cb0..8735645acc7769da68d7dbc60e8b453d7b4018d6 100644
--- a/src/platform/power_manager/xidle-example.cc
+++ b/src/platform/power_manager/xidle-example.cc
@@ -5,10 +5,13 @@
#include <inttypes.h>
#include <cstdio>
#include "power_manager/xidle.h"
+#include "base/logging.h"
Daniel Erat 2010/03/16 21:40:01 alphabetize these?
int main(int argc, char *argv[]) {
power_manager::XIdle idle;
- idle.Init();
+ Display* display = XOpenDisplay(NULL);
Daniel Erat 2010/03/16 21:40:01 it'd be good to CHECK(display) here; that's what X
+ bool init = idle.Init(display);
+ CHECK(init);
idle.AddIdleTimeout(2000);
idle.AddIdleTimeout(5000);
bool is_idle;
@@ -19,5 +22,6 @@ int main(int argc, char *argv[]) {
else
printf("User is active\n");
}
+ XCloseDisplay(display);
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698