Ticket #29: screensaver-x11.diff
File screensaver-x11.diff, 4.2 KB (added by , 19 years ago) |
---|
-
configure
60 60 PROFILEFLAGS="" 61 61 proc_opt="no" 62 62 dvd="yes" 63 xss="no" 63 64 v4l="no" 64 65 frontend="yes" 65 66 backend="no" … … 134 135 echo " --disable-audio-arts disable aRts audio support" 135 136 echo " --disable-audio-jack disable JACK audio support" 136 137 echo " --disable-dvd disable native DVD playback" 138 echo " --enable-xss enable XScreenSaver support" 137 139 echo " --disable-frontend disable frontend [breaks dependency checking]" 138 140 echo " --disable-backend disable backend [breaks dependency checking]" 139 141 #echo " --disable-audio-beos disable BeOS audio support [default=no]" … … 745 747 ;; 746 748 --disable-dvd) dvd="no" 747 749 ;; 750 --enable-xss) xss="yes" 751 ;; 752 --disable-xss) xss="no" 753 ;; 748 754 --enable-frontend) frontend="yes" 749 755 ;; 750 756 --disable-frontend) frontend="no" … … 1990 1996 1991 1997 echo "# Misc Features" 1992 1998 echo "DVD playback $dvd" 1999 echo "XScreenSaver $xss" 1993 2000 echo "Frontend $frontend" 1994 2001 echo "Backend $backend" 1995 2002 echo … … 2517 2524 echo "CONFIG_DVD_LIBS=-ldvdnav" >> $MYTH_CONFIG_MAK 2518 2525 fi 2519 2526 2520 2527 if test x"$xss" = x"yes" ; then 2528 CCONFIG="$CCONFIG using_xss" 2529 fi 2530 2521 2531 if test x"$xrandr" = x"yes" ; then 2522 2532 CCONFIG="$CCONFIG using_xrandr" 2523 2533 fi -
libs/libmyth/screensaver-x11.cpp
8 8 } 9 9 10 10 #include "mythcontext.h" 11 #include "util.h" 11 12 13 ScreenSaverXSSTimer::ScreenSaverXSSTimer() 14 { 15 resetTimer = new QTimer(); 16 connect(resetTimer, SIGNAL(timeout()), this, SLOT(resetSlot())); 17 } 18 19 ScreenSaverXSSTimer::~ScreenSaverXSSTimer() 20 { 21 if (resetTimer) 22 { 23 delete resetTimer; 24 } 25 } 26 27 void ScreenSaverXSSTimer::resetXSS() 28 { 29 myth_system(QString("xscreensaver-command -deactivate >&- 2>&- &")); 30 } 31 32 void ScreenSaverXSSTimer::resetSlot() 33 { 34 resetXSS(); 35 } 36 12 37 class ScreenSaverX11Private 13 38 { 14 39 struct … … 27 52 ScreenSaverX11::ScreenSaverX11() 28 53 { 29 54 d = new ScreenSaverX11Private(); 55 #ifdef USE_XSS 56 t = new ScreenSaverXSSTimer(); 57 t->timeoutInterval = 60000; 58 #endif 30 59 } 31 60 32 61 ScreenSaverX11::~ScreenSaverX11() 33 62 { 34 63 delete d; 64 #ifdef USE_XSS 65 delete t; 66 #endif 35 67 } 36 68 37 69 void ScreenSaverX11::Disable(void) … … 63 95 VERBOSE(VB_GENERAL, "Disable DPMS"); 64 96 } 65 97 } 98 99 #ifdef USE_XSS 100 if (t->resetTimer->isActive()) 101 { 102 t->resetTimer->stop(); 103 } 104 t->resetTimer->start(t->timeoutInterval, FALSE); 105 #endif 66 106 } 67 107 68 108 void ScreenSaverX11::Restore(void) … … 84 124 VERBOSE(VB_GENERAL, "Enable DPMS"); 85 125 } 86 126 } 127 128 #ifdef USE_XSS 129 if (t->resetTimer->isActive()) 130 { 131 t->resetTimer->stop(); 132 } 133 #endif 87 134 } 88 135 89 136 void ScreenSaverX11::Reset(void) 90 137 { 91 138 XResetScreenSaver(qt_xdisplay()); 139 #ifdef USE_XSS 140 t->resetXSS(); 141 #endif 92 142 } 93 -
libs/libmyth/libmyth.pro
138 138 SOURCES += audiooutputdx.cpp 139 139 } 140 140 141 using_xss { 142 DEFINES += USE_XSS 143 } 144 141 145 using_x11 { 142 146 HEADERS += screensaver-x11.h 143 147 SOURCES += screensaver-x11.cpp -
libs/libmyth/screensaver-x11.h
3 3 4 4 #include "screensaver.h" 5 5 6 #include <qobject.h> 7 #include <qtimer.h> 8 9 class ScreenSaverXSSTimer : public QObject 10 { 11 Q_OBJECT 12 public: 13 ScreenSaverXSSTimer(); 14 ~ScreenSaverXSSTimer(); 15 void resetXSS(void); 16 int timeoutInterval; 17 QTimer *resetTimer; 18 19 private slots: 20 void resetSlot(); 21 22 }; 23 6 24 class ScreenSaverX11 : public ScreenSaverControl 7 25 { 8 26 public: … … 15 33 16 34 protected: 17 35 class ScreenSaverX11Private *d; 36 class ScreenSaverXSSTimer *t; 18 37 }; 19 38 20 39 #endif // MYTH_SCREENSAVER_X11_H