summaryrefslogtreecommitdiffstats
path: root/src/inactivity.h
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2016-03-13 16:50:36 +0100
committerMichele Calgaro <[email protected]>2016-03-13 16:50:36 +0100
commitd67bc99f08c6ba9113a769c45538ab3711cc1cfa (patch)
treea288b1a17230f7fa4a1e759d2455c2a43a4c984d /src/inactivity.h
parent2f0cf5202c83fe9d034dc3254e8db127f5bdffe3 (diff)
downloadtdepowersave-d67bc99f08c6ba9113a769c45538ab3711cc1cfa.tar.gz
tdepowersave-d67bc99f08c6ba9113a769c45538ab3711cc1cfa.zip
Fixed up timer for autosuspend and autodimm when a screensaver is also in use. This resolves bug 2603.
Signed-off-by: Michele Calgaro <[email protected]>
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: