summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2008-04-10 14:41:10 +0000
committerphintuka <phintuka>2008-04-10 14:41:10 +0000
commit3a705014206ff477d00558de8d198aee42c0d827 (patch)
treeeaaf33630d314b39d68822285dc706c927823087
parent3344e04cef9761a54b7374d12e979c3c264146e2 (diff)
downloadxineliboutput-3a705014206ff477d00558de8d198aee42c0d827.tar.gz
xineliboutput-3a705014206ff477d00558de8d198aee42c0d827.tar.bz2
Restore DPMS state at exit
-rw-r--r--xine_sxfe_frontend.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c
index 473064ef..7a8f0562 100644
--- a/xine_sxfe_frontend.c
+++ b/xine_sxfe_frontend.c
@@ -4,12 +4,11 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_sxfe_frontend.c,v 1.39 2008-04-10 10:43:18 phintuka Exp $
+ * $Id: xine_sxfe_frontend.c,v 1.40 2008-04-10 14:41:10 phintuka Exp $
*
*/
/*#define HAVE_XF86VIDMODE*/
-#define HAVE_XDPMS
#include <errno.h>
#include <inttypes.h>
@@ -122,6 +121,9 @@ typedef struct sxfe_s {
int XF86_modelines_count;
XF86VidModeModeInfo** XF86_modelines;
#endif
+#ifdef HAVE_XDPMS
+ BOOL dpms_state;
+#endif
/* Atoms */
Atom atom_wm_delete_window;
@@ -1002,8 +1004,11 @@ static int sxfe_display_open(frontend_t *this_gen, int width, int height, int fu
{
int dpms_dummy;
if (DPMSQueryExtension(this->display, &dpms_dummy, &dpms_dummy) && DPMSCapable(this->display)) {
-/* DPMSInfo(dpy, &dpms_state, &dpms_on); */
+ CARD16 dpms_level;
+ DPMSInfo(this->display, &dpms_level, &this->dpms_state);
DPMSDisable(this->display);
+ } else {
+ LOGMSG("sxfe_display_open: DPMS unavailable");
}
}
#endif
@@ -1392,6 +1397,10 @@ static void sxfe_display_close(frontend_t *this_gen)
if(this->xine)
this->fe.xine_exit(this_gen);
+#ifdef HAVE_XDPMS
+ if(this->dpms_state == TRUE)
+ DPMSEnable(this->display);
+#endif
if(this->window_id <= 0) {
XLockDisplay(this->display);
XUnmapWindow(this->display, this->window[this->fullscreen ? 1 : 0]);