Commit 096bab67 authored by Andriy Palamarchuk's avatar Andriy Palamarchuk Committed by Alexandre Julliard

Implemented processing for actions SPI_GET/SETSCREENSAVETIMEOUT,

SPI_GET/SETSCREENSAVEACTIVE, SPI_GET/SETSCREENSAVERRUNNING.
parent a630510b
...@@ -490,10 +490,16 @@ BOOL X11DRV_GetScreenSaveActive(void) ...@@ -490,10 +490,16 @@ BOOL X11DRV_GetScreenSaveActive(void)
*/ */
void X11DRV_SetScreenSaveActive(BOOL bActivate) void X11DRV_SetScreenSaveActive(BOOL bActivate)
{ {
if(bActivate) int timeout, interval, prefer_blanking, allow_exposures;
TSXActivateScreenSaver(gdi_display); static int last_timeout = 15 * 60;
else
TSXResetScreenSaver(gdi_display); TSXGetScreenSaver(gdi_display, &timeout, &interval, &prefer_blanking,
&allow_exposures);
if (timeout) last_timeout = timeout;
timeout = bActivate ? last_timeout : 0;
TSXSetScreenSaver(gdi_display, timeout, interval, prefer_blanking,
allow_exposures);
} }
/*********************************************************************** /***********************************************************************
...@@ -515,8 +521,14 @@ int X11DRV_GetScreenSaveTimeout(void) ...@@ -515,8 +521,14 @@ int X11DRV_GetScreenSaveTimeout(void)
*/ */
void X11DRV_SetScreenSaveTimeout(int nTimeout) void X11DRV_SetScreenSaveTimeout(int nTimeout)
{ {
int timeout, interval, prefer_blanking, allow_exposures;
TSXGetScreenSaver(gdi_display, &timeout, &interval, &prefer_blanking,
&allow_exposures);
/* timeout is a 16bit entity (CARD16) in the protocol, so it should /* timeout is a 16bit entity (CARD16) in the protocol, so it should
* not get over 32767 or it will get negative. */ * not get over 32767 or it will get negative. */
if (nTimeout>32767) nTimeout = 32767; if (nTimeout>32767) nTimeout = 32767;
TSXSetScreenSaver(gdi_display, nTimeout, 60, DefaultBlanking, DefaultExposures); TSXSetScreenSaver(gdi_display, nTimeout, interval, prefer_blanking,
allow_exposures);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment