summaryrefslogtreecommitdiffstats
path: root/kdesktop/lock/lockprocess.cc
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-25 08:34:19 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-25 08:34:19 -0500
commit704eedf364cefe87cf5c63cb61a3c6051a37a585 (patch)
treeee1ba694ad783a3a4ab4fadbb831a2e98c8e3f73 /kdesktop/lock/lockprocess.cc
parent33dc3f2d3960e4a7e5d51b00a6e511a7e326d36f (diff)
parent1c7bdfda1e7c768525a73d1ca104db53ff1cec10 (diff)
downloadtdebase-704eedf364cefe87cf5c63cb61a3c6051a37a585.tar.gz
tdebase-704eedf364cefe87cf5c63cb61a3c6051a37a585.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdebase
Diffstat (limited to 'kdesktop/lock/lockprocess.cc')
-rw-r--r--kdesktop/lock/lockprocess.cc69
1 files changed, 46 insertions, 23 deletions
diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc
index 82952431a..1947793c9 100644
--- a/kdesktop/lock/lockprocess.cc
+++ b/kdesktop/lock/lockprocess.cc
@@ -130,6 +130,8 @@ Status DPMSInfo ( Display *, CARD16 *, BOOL * );
#define XF86XK_AudioLowerVolume 0x1008FF11
#define XF86XK_Display 0x1008FF59
+#define DPMS_MONITOR_BLANKED(x) ((x == DPMSModeStandby) || (x == DPMSModeSuspend) || (x == DPMSModeOff))
+
static Window gVRoot = 0;
static Window gVRootData = 0;
static Atom gXA_VROOT;
@@ -376,7 +378,7 @@ void LockProcess::init(bool child, bool useBlankOnly)
connect(&mSuspendTimer, TQT_SIGNAL(timeout()), TQT_SLOT(suspend()));
#ifdef HAVE_DPMS
- //if the user decided that the screensaver should run independent from
+ //if the user decided that the screensaver should run independent from
//dpms, we shouldn't check for it, aleXXX
if (KDesktopSettings::dpmsDependent()) {
BOOL on;
@@ -1436,15 +1438,34 @@ bool LockProcess::startLock()
void LockProcess::closeDialogAndStartHack()
{
- // Close any active dialogs
- DISABLE_CONTINUOUS_LOCKDLG_DISPLAY
- mSuspended = true;
- if (closeCurrentWindow()) {
- TQTimer::singleShot( 0, this, SLOT(closeDialogAndStartHack()) );
- }
- else {
- resume(true);
- }
+#ifdef HAVE_DPMS
+ if (KDesktopSettings::dpmsDependent()) {
+ BOOL on;
+ CARD16 state;
+ if (DPMSInfo(tqt_xdisplay(), &state, &on)) {
+ //kdDebug() << "checkDPMSActive " << on << " " << state << endl;
+ if (DPMS_MONITOR_BLANKED(state)) {
+ // Make sure saver will attempt to start again after DPMS wakeup
+ // This is related to Bug 1475
+ ENABLE_CONTINUOUS_LOCKDLG_DISPLAY
+ if (mHackStartupEnabled) mHackDelayStartupTimer->start(mHackDelayStartupTimeout, TRUE);
+ // Should not start saver here, because the DPMS check method below would turn it right back off!
+ // This is related to Bug 1475
+ return;
+ }
+ }
+ }
+#endif
+
+ // Close any active dialogs
+ DISABLE_CONTINUOUS_LOCKDLG_DISPLAY
+ mSuspended = true;
+ if (closeCurrentWindow()) {
+ TQTimer::singleShot( 0, this, SLOT(closeDialogAndStartHack()) );
+ }
+ else {
+ resume(true);
+ }
}
void LockProcess::repaintRootWindowIfNeeded()
@@ -2218,19 +2239,21 @@ void LockProcess::stayOnTop()
void LockProcess::checkDPMSActive()
{
#ifdef HAVE_DPMS
- BOOL on;
- CARD16 state;
- DPMSInfo(tqt_xdisplay(), &state, &on);
- //kdDebug() << "checkDPMSActive " << on << " " << state << endl;
- if (state == DPMSModeStandby || state == DPMSModeSuspend || state == DPMSModeOff)
- {
- suspend();
- } else if ( mSuspended )
- {
- if (mResizingDesktopLock == false) {
- resume( true );
- }
- }
+ if (KDesktopSettings::dpmsDependent()) {
+ BOOL on;
+ CARD16 state;
+ if (DPMSInfo(tqt_xdisplay(), &state, &on)) {
+ //kdDebug() << "checkDPMSActive " << on << " " << state << endl;
+ if (DPMS_MONITOR_BLANKED(state)) {
+ suspend();
+ }
+ else if (mSuspended) {
+ if (mResizingDesktopLock == false) {
+ resume( true );
+ }
+ }
+ }
+ }
#endif
}