diff options
Diffstat (limited to 'src/screen.cpp')
-rw-r--r-- | src/screen.cpp | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/src/screen.cpp b/src/screen.cpp index 4adb0f4..ef68a26 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -17,12 +17,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ /*! \file screen.cpp - * All here displayed file members of screen.cpp are related to operations with the - * XSreensaver/XServer. This functions are basic/low level operations. They are + * All here displayed file members of screen.cpp are related to operations with the + * XSreensaver/XServer. This functions are basic/low level operations. They are * inspired, partly copied and modified from <a href="http://www.mplayerhq.hu/">MPlayer</a> * code (1.05pre). Thanks for the inspiration. \n \n - * All 'higher level' class members of the class screen can be found here: \ref screen - * \brief In this file can be found all screensaver related code. + * All 'higher level' class members of the class screen can be found here: \ref screen + * \brief In this file can be found all screensaver related code. * \author Danny Kukawka, <[email protected]>, <[email protected]> * \date 2004 - 2006 */ @@ -81,7 +81,7 @@ bool screen::setScreenSaver(bool enable){ kdDebugFuncIn(trace); if(SCREENSAVER_STATUS == -1) SCREENSAVER_STATUS = checkScreenSaverStatus(); - if((SCREENSAVER_STATUS == 1) || (SCREENSAVER_STATUS == 0)){ + if((SCREENSAVER_STATUS == 1) || (SCREENSAVER_STATUS == 0)){ screen_save_dcop_ref.send( "enable", enable); kdDebugFuncOut(trace); return true; @@ -298,6 +298,36 @@ int screen::checkScreenSaverStatus() { return -1; } +bool screen::checkScreenSaverActive() +{ + // Check whether the screensaver is enabled + bool flagOK = false; + bool get_reply = false; + DCOPReply reply = screen_save_dcop_ref.call("isEnabled()"); + if (reply.isValid()) { + if (reply.get(get_reply)) { + if (get_reply) { + flagOK = true; + } + } + } + if (!flagOK) { + return false; + } + // Check whether the screensaver is displayed + flagOK = false; + get_reply = false; + reply = screen_save_dcop_ref.call("isBlanked()"); + if (reply.isValid()) { + if (reply.get(get_reply)) { + if (get_reply) { + flagOK = true; + } + } + } + return flagOK; +} + /*! * \b TQT_SLOT which called if the call of gnomescreensaver-command exited * \param gnomecheckcommand the KPocess which called this SLOT @@ -435,7 +465,7 @@ bool screen::lockScreen(){ if(SCREENSAVER_STATUS == -1) SCREENSAVER_STATUS = checkScreenSaverStatus(); // set lock for TDEScreensaver - if((SCREENSAVER_STATUS == 1) || (SCREENSAVER_STATUS == 0)){ + if((SCREENSAVER_STATUS == 1) || (SCREENSAVER_STATUS == 0)){ DCOPReply reply = screen_save_dcop_ref.call("lock"); if ( reply.isValid() ) { return true; |