mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
winex11: Move the screen saver support to a new SystemParametersInfo entry point.
This commit is contained in:
parent
13fbce5627
commit
67d16ddee3
2 changed files with 30 additions and 27 deletions
|
@ -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;
|
||||
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;
|
||||
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 );
|
||||
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 */
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue