Index: libs/libmyth/util.h
===================================================================
--- libs/libmyth/util.h	(revision 6733)
+++ libs/libmyth/util.h	(working copy)
@@ -54,4 +54,6 @@
 bool getUptime(time_t &uptime);
 bool getMemStats(int &totalMB, int &freeMB, int &totalVM, int &freeVM);
 
+bool processRunning(const QString &pName);
+
 #endif // UTIL_H_
Index: libs/libmyth/screensaver-x11.cpp
===================================================================
--- libs/libmyth/screensaver-x11.cpp	(revision 6733)
+++ libs/libmyth/screensaver-x11.cpp	(working copy)
@@ -8,6 +8,7 @@
 }
 
 #include "mythcontext.h"
+#include "util.h"
 
 class ScreenSaverX11Private 
 {
@@ -19,19 +20,49 @@
         int preferblank;
         int allowexposure;
         bool dpmsdisabled;
+        bool xscreensaverRunning;
     } state;
 
     friend class ScreenSaverX11;
 };
 
+ScreenSaverXSSTimer::ScreenSaverXSSTimer() 
+{
+    resetTimer = new QTimer();
+    connect(resetTimer, SIGNAL(timeout()), this, SLOT(resetSlot()));
+}
+
+ScreenSaverXSSTimer::~ScreenSaverXSSTimer() 
+{
+    delete resetTimer;
+}
+
+void ScreenSaverXSSTimer::resetXSS() 
+{
+    myth_system(QString("xscreensaver-command -deactivate >&- 2>&- &")); 
+}
+
+void ScreenSaverXSSTimer::resetSlot() 
+{
+    resetXSS();
+}
+
 ScreenSaverX11::ScreenSaverX11() 
 {
     d = new ScreenSaverX11Private();
+    d->state.xscreensaverRunning = processRunning("xscreensaver");
+    if (d->state.xscreensaverRunning) 
+    {
+        t = new ScreenSaverXSSTimer();
+        t->timeoutInterval = -1;
+        VERBOSE(VB_GENERAL, QString("XScreenSaver support enabled"));
+    }
 }
 
 ScreenSaverX11::~ScreenSaverX11() 
 {
     delete d;
+    delete t; 
 }
 
 void ScreenSaverX11::Disable(void) 
@@ -63,6 +94,25 @@
             VERBOSE(VB_GENERAL, "Disable DPMS");
         }
     }
+
+    if (d->state.xscreensaverRunning)
+    {
+        if (t->resetTimer)
+        {
+            t->resetTimer->stop();
+        }
+        if (t->timeoutInterval == -1)
+        {
+            t->timeoutInterval = 
+                gContext->GetNumSettingOnHost("xscreensaverInterval",
+                                          gContext->GetHostName(),
+                                          60) * 1000;
+        }
+        if (t->timeoutInterval > 0)
+        {
+            t->resetTimer->start(t->timeoutInterval, FALSE);
+        }
+    }
 }
 
 void ScreenSaverX11::Restore(void) 
@@ -84,10 +134,22 @@
             VERBOSE(VB_GENERAL, "Enable DPMS");
         }
     }
+
+    if (d->state.xscreensaverRunning)
+    {
+        if (t->resetTimer)
+        {
+            t->resetTimer->stop();
+        }
+    }
 }
 
 void ScreenSaverX11::Reset(void) 
 {
     XResetScreenSaver(qt_xdisplay());
+    if (d->state.xscreensaverRunning)
+    {
+        t->resetXSS();
+    }
 }
 
Index: libs/libmyth/util.cpp
===================================================================
--- libs/libmyth/util.cpp	(revision 6733)
+++ libs/libmyth/util.cpp	(working copy)
@@ -28,6 +28,9 @@
 #include <qpainter.h>
 #include <qpixmap.h>
 #include <qfont.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <qregexp.h>
 
 // Myth headers
 #include "mythconfig.h"
@@ -1068,3 +1071,49 @@
 
     return true;
 }
+
+/** \fn processRunning(QString&)
+ *  \brief Returns the running state of a process.
+ *
+ *  \todo Add support for other platforms.
+ *  \return true if process is running, false otherwise.
+ */
+bool processRunning(const QString &pName)
+{
+#ifdef __linux__
+//  Parse /proc pseudo-fs for pid's
+    QDir procDir(QString("/proc"));
+    procDir.setFilter(QDir::Dirs | QDir::Readable);
+    if (procDir.exists())
+    {
+        QStringList processes = procDir.entryList();
+        for (QStringList::iterator i = processes.begin(); i != processes.end(); i++)
+        {
+            QString process = *i;
+            QRegExp rx( "^\\d+$" );
+            if (rx.search(process) == 0)
+            {
+//              Get process name from stat file
+                QFile processStatFile(QString("/proc/%1/stat").arg(process));
+                if (processStatFile.open(IO_ReadOnly))
+                {
+                    QTextStream stream(&processStatFile);
+                    QString processName;
+                    stream >> processName >> processName;
+                    processStatFile.close();
+                    if (QString("(%1)").arg(pName) == processName)
+                    {
+                        return true;
+                    }
+                }
+            }
+        }
+    } 
+
+#else
+    VERBOSE(VB_IMPORTANT, "processRunning(): Error, "
+            "only linux supported");
+#endif
+
+    return false;
+}
Index: libs/libmyth/screensaver-x11.h
===================================================================
--- libs/libmyth/screensaver-x11.h	(revision 6733)
+++ libs/libmyth/screensaver-x11.h	(working copy)
@@ -3,6 +3,24 @@
 
 #include "screensaver.h"
 
+#include <qobject.h> 
+#include <qtimer.h> 
+
+class ScreenSaverXSSTimer : public QObject
+{
+    Q_OBJECT
+public:
+    ScreenSaverXSSTimer();
+    ~ScreenSaverXSSTimer();
+    void resetXSS(void);
+    int timeoutInterval;
+    QTimer *resetTimer;
+
+private slots:
+    void resetSlot();
+
+};
+
 class ScreenSaverX11 : public ScreenSaverControl
 {
 public:
@@ -15,6 +33,7 @@
 
 protected:
     class ScreenSaverX11Private *d;
+    class ScreenSaverXSSTimer *t;
 };
 
 #endif // MYTH_SCREENSAVER_X11_H
