Index: libs/libmyth/screensaver-osx.cpp
===================================================================
--- libs/libmyth/screensaver-osx.cpp	(revision 8529)
+++ libs/libmyth/screensaver-osx.cpp	(working copy)
@@ -61,3 +61,7 @@
     ScreenSaverOSXPrivate::timerCallback(NULL, NULL);
 }
 
+bool ScreenSaverOSX::Asleep(void)
+{
+    return 0;
+}
Index: libs/libmyth/screensaver-x11.cpp
===================================================================
--- libs/libmyth/screensaver-x11.cpp	(revision 8529)
+++ libs/libmyth/screensaver-x11.cpp	(working copy)
@@ -20,8 +20,10 @@
         int interval;
         int preferblank;
         int allowexposure;
-        bool dpmsdisabled;
         bool xscreensaverRunning;
+        BOOL dpmsaware;
+        BOOL dpmsenabled;
+        bool dpmsdefeated;
     } state;
 
     QTimer *resetTimer;
@@ -44,10 +46,40 @@
         d->timeoutInterval = -1;
         VERBOSE(VB_GENERAL, "XScreenSaver support enabled");
     }
+
+    int dummy;
+    if ((d->state.dpmsaware = DPMSQueryExtension(qt_xdisplay(),&dummy,&dummy)))
+    {
+        CARD16 power_level;
+
+	/* If someone runs into X server weirdness that goes away when
+	 * they externally disable DPMS, then the 'dpmsenabled' test should
+	 * be short circuited by a call to 'DPMSCapable()'. Be sure to
+	 * manually initialize dpmsenabled to false.
+	 */
+
+        DPMSInfo(qt_xdisplay(), &power_level, &(d->state.dpmsenabled));
+
+        if (d->state.dpmsenabled)
+            VERBOSE(VB_GENERAL, "DPMS is active.");
+        else
+            VERBOSE(VB_GENERAL, "DPMS is disabled.");
+
+    } else {
+        d->state.dpmsenabled = false;
+        VERBOSE(VB_GENERAL, "DPMS is not supported.");
+    }
+
+    d->state.dpmsdefeated = false;
+
 }
 
 ScreenSaverX11::~ScreenSaverX11() 
 {
+    /* Ensure DPMS gets left as it was found. */
+    if (d->state.dpmsdefeated)
+        Restore();
+
     delete d;
 }
 
@@ -65,20 +97,11 @@
     XResetScreenSaver(qt_xdisplay());
     XSetScreenSaver(qt_xdisplay(), 0, 0, 0, 0);
 
-    int nothing;
-
-    if (DPMSQueryExtension(qt_xdisplay(), &nothing, &nothing))
+    if (d->state.dpmsenabled)
     {
-        BOOL on;
-        CARD16 power_level;
-
-        DPMSInfo(qt_xdisplay(), &power_level, &on);
-        if (on)
-        {
-            d->state.dpmsdisabled = true;
-            DPMSDisable(qt_xdisplay());       // monitor powersave off
-            VERBOSE(VB_GENERAL, "Disable DPMS");
-        }
+        d->state.dpmsdefeated = true;
+        DPMSDisable(qt_xdisplay());
+        VERBOSE(VB_GENERAL, "DPMS powerdown defeated.");
     }
 
     if (d->state.xscreensaverRunning)
@@ -109,15 +132,11 @@
                     d->state.allowexposure);
     d->state.saved = false;
 
-    if (d->state.dpmsdisabled)
+    if (d->state.dpmsdefeated)
     {
-        int nothing;
-        d->state.dpmsdisabled = false;
-        if (DPMSQueryExtension(qt_xdisplay(), &nothing, &nothing))
-        {
-            DPMSEnable(qt_xdisplay());
-            VERBOSE(VB_GENERAL, "Enable DPMS");
-        }
+        d->state.dpmsdefeated = false;
+        DPMSEnable(qt_xdisplay());
+        VERBOSE(VB_GENERAL, "DPMS powerdown re-enabled.");
     }
 
     if (d->state.xscreensaverRunning && d->resetTimer)
@@ -130,20 +149,31 @@
     if (d->state.xscreensaverRunning)
         resetSlot();
 
-    int nothing;
-    if (DPMSQueryExtension(qt_xdisplay(), &nothing, &nothing))
+    if (Asleep())
     {
-        BOOL on;
-        CARD16 power_level;
-        if (!d->state.dpmsdisabled) 
-        {
-            DPMSInfo(qt_xdisplay(), &power_level, &on);
-            if (power_level != DPMSModeOn)
-                DPMSForceLevel(qt_xdisplay(), DPMSModeOn);
-        }
+        DPMSForceLevel(qt_xdisplay(), DPMSModeOn);
+	// Calling XSync is necessary for the case when Myth executes
+	// another application before the event loop regains control
+        XSync(qt_xdisplay(), false);
     }
 }
 
+bool ScreenSaverX11::Asleep(void)
+{
+    if (!d->state.dpmsenabled)
+        return 0;
+
+    if (d->state.dpmsdefeated)
+        return 0;
+
+    BOOL on;
+    CARD16 power_level;
+
+    DPMSInfo(qt_xdisplay(), &power_level, &on);
+
+    return (power_level != DPMSModeOn);
+}
+
 void ScreenSaverX11::resetSlot() 
 {
     myth_system(QString("xscreensaver-command -deactivate >&- 2>&- &")); 
Index: libs/libmyth/screensaver-null.cpp
===================================================================
--- libs/libmyth/screensaver-null.cpp	(revision 8529)
+++ libs/libmyth/screensaver-null.cpp	(working copy)
@@ -17,3 +17,8 @@
 void ScreenSaverNull::Reset(void)
 {
 }
+
+bool ScreenSaverNull::Asleep(void)
+{
+    return 0;
+}
Index: libs/libmyth/mythdialogs.cpp
===================================================================
--- libs/libmyth/mythdialogs.cpp	(revision 8529)
+++ libs/libmyth/mythdialogs.cpp	(working copy)
@@ -772,6 +772,12 @@
     else if (ce->type() == kMediaEventType) 
     {
         MediaEvent *media_event = (MediaEvent*)ce;
+
+        /* Media inserts are always a manual user action.
+         * We should wake up the screen on it whether it can play or not.
+         */
+        gContext->DoResetScreensaver();
+
         // Let's see which of our jump points are configured to handle this 
         // type of media...  If there's more than one we'll want to show some 
         // UI to allow the user to select which jump point to use. But for 
Index: libs/libmyth/screensaver.h
===================================================================
--- libs/libmyth/screensaver.h	(revision 8529)
+++ libs/libmyth/screensaver.h	(working copy)
@@ -36,6 +36,8 @@
     virtual void Disable(void) = 0;
     virtual void Restore(void) = 0;
     virtual void Reset(void) = 0;
+
+    virtual bool Asleep(void) = 0;
 };
 
 #endif // MYTH_SCREENSAVER_H
Index: libs/libmyth/screensaver-null.h
===================================================================
--- libs/libmyth/screensaver-null.h	(revision 8529)
+++ libs/libmyth/screensaver-null.h	(working copy)
@@ -12,6 +12,8 @@
     void Disable(void);
     void Restore(void);
     void Reset(void);
+
+    bool Asleep(void);
 };
 
 #endif // MYTH_SCREENSAVER_NULL_H
Index: libs/libmyth/screensaver-osx.h
===================================================================
--- libs/libmyth/screensaver-osx.h	(revision 8529)
+++ libs/libmyth/screensaver-osx.h	(working copy)
@@ -13,6 +13,8 @@
     void Restore(void);
     void Reset(void);
 
+    bool Asleep(void);
+
 protected:
     class ScreenSaverOSXPrivate *d;
 };
Index: libs/libmyth/screensaver-x11.h
===================================================================
--- libs/libmyth/screensaver-x11.h	(revision 8529)
+++ libs/libmyth/screensaver-x11.h	(working copy)
@@ -17,6 +17,8 @@
     void Restore(void);
     void Reset(void);
 
+    bool Asleep(void);
+
   public slots:
     void resetSlot();
 
