mirror of
https://github.com/mpv-player/mpv
synced 2025-04-11 04:01:31 +00:00
Use a screensaver_off variable to save current state and avoid
uselessly disabling twice. Also needed for a future patch. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25636 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
e27d606714
commit
f9b1151801
@ -1657,6 +1657,7 @@ static Window xs_windowid = 0;
|
|||||||
static Atom deactivate;
|
static Atom deactivate;
|
||||||
static Atom screensaver;
|
static Atom screensaver;
|
||||||
|
|
||||||
|
static int screensaver_off;
|
||||||
static unsigned int time_last;
|
static unsigned int time_last;
|
||||||
|
|
||||||
void xscreensaver_heartbeat(void)
|
void xscreensaver_heartbeat(void)
|
||||||
@ -1729,6 +1730,9 @@ static int xss_suspend(Bool suspend)
|
|||||||
void saver_on(Display * mDisplay)
|
void saver_on(Display * mDisplay)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (!screensaver_off)
|
||||||
|
return;
|
||||||
|
screensaver_off = 0;
|
||||||
if (xss_suspend(False))
|
if (xss_suspend(False))
|
||||||
return;
|
return;
|
||||||
#ifdef HAVE_XDPMS
|
#ifdef HAVE_XDPMS
|
||||||
@ -1791,6 +1795,9 @@ void saver_off(Display * mDisplay)
|
|||||||
{
|
{
|
||||||
int nothing;
|
int nothing;
|
||||||
|
|
||||||
|
if (screensaver_off)
|
||||||
|
return;
|
||||||
|
screensaver_off = 1;
|
||||||
if (xss_suspend(True))
|
if (xss_suspend(True))
|
||||||
return;
|
return;
|
||||||
#ifdef HAVE_XDPMS
|
#ifdef HAVE_XDPMS
|
||||||
|
Loading…
Reference in New Issue
Block a user