summaryrefslogtreecommitdiffstats
path: root/src/inactivity.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/inactivity.h')
-rw-r--r--src/inactivity.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/inactivity.h b/src/inactivity.h
index e2d88a8..7fafab9 100644
--- a/src/inactivity.h
+++ b/src/inactivity.h
@@ -42,8 +42,14 @@
#include <X11/Xatom.h>
#include <X11/Xutil.h>
+/* needed for lXext C library linkage */
+extern "C" {
+ #include <X11/extensions/scrnsaver.h>
+}
+
// from project
#include "tdepowersave_debug.h"
+#include "screen.h"
/*!
* \file inactivity.h
@@ -63,7 +69,7 @@ class inactivity : public TQWidget
public:
//! default constructor
- inactivity();
+ inactivity(screen *disp);
//! default destructor
~inactivity();
@@ -135,16 +141,21 @@ private:
* The time intervall to check for the current status and time of
* userinactivity. The timeslice is currently 30 sec.
*/
- static const int CHECK_for_INACTIVITY = 30000;
-
+ static const int CHECK_for_INACTIVITY = 10000;
+
//! TQTimer for check inactivity
/*!
* This timer is used to check the currently status and time of
- * userinactivity on the X-Server. The timerinterval is defined trough
+ * user inactivity on the X-Server. The timer interval is defined through
* \ref CHECK_for_INACTIVITY .
*/
TQTimer *checkInactivity;
-
+
+ screen *display; // No ownership here!!
+ bool prev_screensaver_enabled;
+ unsigned long prev_idle_time;
+ unsigned long correction_value;
+
// -------- FUNCTIONS ------------
//! to check the user-inactivity on the XServer
@@ -154,7 +165,7 @@ private:
//! to monitor the values
void check( bool recheck );
//! to workaround a strange behavior of the XScreenSaver extension
- unsigned long workaroundCreepyXServer( unsigned long );
+ unsigned long workaroundCreepyXServer(XScreenSaverInfo *_mitInfo);
private slots: