Module: wine Branch: master Commit: 67d16ddee3ba20ea0aa794a4153fcbbb67869a66 URL: http://source.winehq.org/git/wine.git/?a=commit;h=67d16ddee3ba20ea0aa794a415...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Nov 15 17:46:37 2012 +0100
winex11: Move the screen saver support to a new SystemParametersInfo entry point.
---
dlls/winex11.drv/winex11.drv.spec | 3 +- dlls/winex11.drv/x11drv_main.c | 58 +++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/dlls/winex11.drv/winex11.drv.spec b/dlls/winex11.drv/winex11.drv.spec index db3e4f5..f14be21 100644 --- a/dlls/winex11.drv/winex11.drv.spec +++ b/dlls/winex11.drv/winex11.drv.spec @@ -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 diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 3ff4233..ef6b1a9 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -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 */ }