# HG changeset patch # User reimar # Date 1199708297 0 # Node ID 3ada48a71450fba87ad198a6c29544f1251003c9 # Parent 9d0b189ce1b29a69c945288a24dda081aa809645 Use a screensaver_off variable to save current state and avoid uselessly disabling twice. Also needed for a future patch. diff -r 9d0b189ce1b2 -r 3ada48a71450 libvo/x11_common.c --- a/libvo/x11_common.c Sun Jan 06 23:20:15 2008 +0000 +++ b/libvo/x11_common.c Mon Jan 07 12:18:17 2008 +0000 @@ -1657,6 +1657,7 @@ static Atom deactivate; static Atom screensaver; +static int screensaver_off; static unsigned int time_last; void xscreensaver_heartbeat(void) @@ -1729,6 +1730,9 @@ void saver_on(Display * mDisplay) { + if (!screensaver_off) + return; + screensaver_off = 0; if (xss_suspend(False)) return; #ifdef HAVE_XDPMS @@ -1791,6 +1795,9 @@ { int nothing; + if (screensaver_off) + return; + screensaver_off = 1; if (xss_suspend(True)) return; #ifdef HAVE_XDPMS