Commit 67d16dde authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Move the screen saver support to a new SystemParametersInfo entry point.

parent 13fbce56
......@@ -19,8 +19,6 @@
@ cdecl GetCursorPos(ptr) X11DRV_GetCursorPos
@ cdecl SetCursorPos(long long) X11DRV_SetCursorPos
@ cdecl ClipCursor(ptr) X11DRV_ClipCursor
@ cdecl GetScreenSaveActive() X11DRV_GetScreenSaveActive
@ cdecl SetScreenSaveActive(long) X11DRV_SetScreenSaveActive
@ cdecl ChangeDisplaySettingsEx(ptr ptr long long long) X11DRV_ChangeDisplaySettingsEx
@ cdecl EnumDisplayMonitors(long ptr ptr long) X11DRV_EnumDisplayMonitors
@ cdecl EnumDisplaySettingsEx(ptr long ptr long) X11DRV_EnumDisplaySettingsEx
......@@ -54,6 +52,7 @@
@ cdecl WindowMessage(long long long long) X11DRV_WindowMessage
@ cdecl WindowPosChanging(long long long ptr ptr ptr ptr) X11DRV_WindowPosChanging
@ cdecl WindowPosChanged(long long long ptr ptr ptr ptr ptr) X11DRV_WindowPosChanged
@ cdecl SystemParametersInfo(long long ptr long) X11DRV_SystemParametersInfo
# WinTab32
@ cdecl AttachEventQueueToTablet(long) X11DRV_AttachEventQueueToTablet
......
......@@ -696,35 +696,39 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
return ret;
}
/***********************************************************************
* GetScreenSaveActive (X11DRV.@)
*
* Returns the active status of the screen saver
*/
BOOL CDECL X11DRV_GetScreenSaveActive(void)
{
int timeout, temp;
XGetScreenSaver(gdi_display, &timeout, &temp, &temp, &temp);
return timeout != 0;
}
/***********************************************************************
* SetScreenSaveActive (X11DRV.@)
*
* Activate/Deactivate the screen saver
* SystemParametersInfo (X11DRV.@)
*/
void CDECL X11DRV_SetScreenSaveActive(BOOL bActivate)
BOOL CDECL X11DRV_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param, UINT flags )
{
int timeout, interval, prefer_blanking, allow_exposures;
static int last_timeout = 15 * 60;
XLockDisplay( gdi_display );
XGetScreenSaver(gdi_display, &timeout, &interval, &prefer_blanking,
&allow_exposures);
if (timeout) last_timeout = timeout;
timeout = bActivate ? last_timeout : 0;
XSetScreenSaver(gdi_display, timeout, interval, prefer_blanking,
allow_exposures);
XUnlockDisplay( gdi_display );
switch (action)
{
case SPI_GETSCREENSAVEACTIVE:
if (ptr_param)
{
int timeout, temp;
XGetScreenSaver(gdi_display, &timeout, &temp, &temp, &temp);
*(BOOL *)ptr_param = timeout != 0;
return TRUE;
}
break;
case SPI_SETSCREENSAVEACTIVE:
{
int timeout, interval, prefer_blanking, allow_exposures;
static int last_timeout = 15 * 60;
XLockDisplay( gdi_display );
XGetScreenSaver(gdi_display, &timeout, &interval, &prefer_blanking,
&allow_exposures);
if (timeout) last_timeout = timeout;
timeout = int_param ? last_timeout : 0;
XSetScreenSaver(gdi_display, timeout, interval, prefer_blanking,
allow_exposures);
XUnlockDisplay( gdi_display );
}
break;
}
return FALSE; /* let user32 handle it */
}
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