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; |
} |