Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoann Laissus
wine
Commits
096bab67
Commit
096bab67
authored
23 years ago
by
Andriy Palamarchuk
Committed by
Alexandre Julliard
23 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implemented processing for actions SPI_GET/SETSCREENSAVETIMEOUT,
SPI_GET/SETSCREENSAVEACTIVE, SPI_GET/SETSCREENSAVERRUNNING.
parent
a630510b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/x11drv/x11drv_main.c
+17
-5
17 additions, 5 deletions
dlls/x11drv/x11drv_main.c
windows/sysparams.c
+111
-46
111 additions, 46 deletions
windows/sysparams.c
with
128 additions
and
51 deletions
dlls/x11drv/x11drv_main.c
+
17
−
5
View file @
096bab67
...
...
@@ -490,10 +490,16 @@ BOOL X11DRV_GetScreenSaveActive(void)
*/
void
X11DRV_SetScreenSaveActive
(
BOOL
bActivate
)
{
if
(
bActivate
)
TSXActivateScreenSaver
(
gdi_display
);
else
TSXResetScreenSaver
(
gdi_display
);
int
timeout
,
interval
,
prefer_blanking
,
allow_exposures
;
static
int
last_timeout
=
15
*
60
;
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)
*/
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
* not get over 32767 or it will get negative. */
if
(
nTimeout
>
32767
)
nTimeout
=
32767
;
TSXSetScreenSaver
(
gdi_display
,
nTimeout
,
60
,
DefaultBlanking
,
DefaultExposures
);
TSXSetScreenSaver
(
gdi_display
,
nTimeout
,
interval
,
prefer_blanking
,
allow_exposures
);
}
This diff is collapsed.
Click to expand it.
windows/sysparams.c
+
111
−
46
View file @
096bab67
...
...
@@ -30,10 +30,12 @@ DEFAULT_DEBUG_CHANNEL(system);
#define SPI_SETBORDER_IDX 2
#define SPI_SETKEYBOARDSPEED_IDX 3
#define SPI_ICONHORIZONTALSPACING_IDX 4
#define SPI_SETKEYBOARDDELAY_IDX 5
#define SPI_ICONVERTICALSPACING_IDX 6
#define SPI_SETSHOWSOUNDS_IDX 7
#define SPI_WINE_IDX SPI_SETSHOWSOUNDS_IDX
#define SPI_SETSCREENSAVETIMEOUT_IDX 5
#define SPI_SETKEYBOARDDELAY_IDX 6
#define SPI_ICONVERTICALSPACING_IDX 7
#define SPI_SETSHOWSOUNDS_IDX 8
#define SPI_SETSCREENSAVERRUNNING_IDX 9
#define SPI_WINE_IDX SPI_SETSCREENSAVERRUNNING_IDX
/**
* Names of the registry subkeys of HKEY_CURRENT_USER key and value names
...
...
@@ -54,12 +56,16 @@ DEFAULT_DEBUG_CHANNEL(system);
#define SPI_SETKEYBOARDSPEED_VALNAME "KeyboardSpeed"
#define SPI_ICONHORIZONTALSPACING_REGKEY "Control Panel\\Desktop"
#define SPI_ICONHORIZONTALSPACING_VALNAME "IconSpacing"
#define SPI_SETSCREENSAVETIMEOUT_REGKEY "Control Panel\\Desktop"
#define SPI_SETSCREENSAVETIMEOUT_VALNAME "ScreenSaveTimeOut"
#define SPI_SETKEYBOARDDELAY_REGKEY "Control Panel\\Keyboard"
#define SPI_SETKEYBOARDDELAY_VALNAME "KeyboardDelay"
#define SPI_ICONVERTICALSPACING_REGKEY "Control Panel\\Desktop"
#define SPI_ICONVERTICALSPACING_VALNAME "IconVerticalSpacing"
#define SPI_SETSHOWSOUNDS_REGKEY "Control Panel\\Accessibility\\ShowSounds"
#define SPI_SETSHOWSOUNDS_VALNAME "On"
#define SPI_SETSCREENSAVERRUNNING_REGKEY "Control Panel\\Desktop"
#define SPI_SETSCREENSAVERRUNNING_VALNAME "WINE_ScreenSaverRunning"
/* volatile registry branch under CURRENT_USER_REGKEY for temporary values storage */
#define WINE_CURRENT_USER_REGKEY "Wine"
...
...
@@ -76,7 +82,9 @@ static int mouse_threshold2 = 10;
static
int
mouse_speed
=
1
;
static
int
border
=
1
;
static
int
keyboard_speed
=
31
;
static
int
screensave_timeout
=
300
;
static
int
keyboard_delay
=
1
;
static
BOOL
screensaver_running
=
FALSE
;
/***********************************************************************
* GetTimerResolution (USER.14)
...
...
@@ -190,6 +198,11 @@ void SYSPARAMS_Reset( UINT uiAction )
if (uiAction) \
break
#define WINE_IGNORE_SPI(x) \
case x: \
if (uiAction) \
break
#define WINE_INVALIDATE_SPI(x) \
case x: \
spi_loaded[x##_IDX] = FALSE; \
...
...
@@ -207,6 +220,7 @@ void SYSPARAMS_Reset( UINT uiAction )
WINE_RELOAD_SPI
(
SPI_SETBORDER
);
WINE_RELOAD_SPI
(
SPI_ICONHORIZONTALSPACING
);
WINE_RELOAD_SPI
(
SPI_ICONVERTICALSPACING
);
WINE_IGNORE_SPI
(
SPI_SETSCREENSAVEACTIVE
);
WINE_RELOAD_SPI
(
SPI_SETSHOWSOUNDS
);
default:
...
...
@@ -218,7 +232,9 @@ void SYSPARAMS_Reset( UINT uiAction )
WINE_INVALIDATE_SPI
(
SPI_SETBEEP
);
WINE_INVALIDATE_SPI
(
SPI_SETMOUSE
);
WINE_INVALIDATE_SPI
(
SPI_SETKEYBOARDSPEED
);
WINE_INVALIDATE_SPI
(
SPI_SETSCREENSAVETIMEOUT
);
WINE_INVALIDATE_SPI
(
SPI_SETKEYBOARDDELAY
);
WINE_INVALIDATE_SPI
(
SPI_SETSCREENSAVERRUNNING
);
default:
FIXME
(
"Unknown action reset: %u
\n
"
,
uiAction
);
break
;
...
...
@@ -233,6 +249,7 @@ void SYSPARAMS_Reset( UINT uiAction )
ERR
(
"Incorrect implementation of SYSPARAMS_Reset. "
"Not all params are reloaded.
\n
"
);
#undef WINE_INVALIDATE_SPI
#undef WINE_IGNORE_SPI
#undef WINE_RELOAD_SPI
}
...
...
@@ -248,17 +265,6 @@ static HKEY get_volatile_regkey(void)
if
(
!
volatile_key
)
{
/* FIXME - check whether the key exists
notify_change = FALSE;
if (WINE_CURRENT_USER_REGKEY does not exist)
{
initialize system parameters info which take values from X settings,
if(current settings differ from X)
change current setting and save it;
}
notify_change = TRUE;
*/
if
(
RegCreateKeyExA
(
HKEY_CURRENT_USER
,
WINE_CURRENT_USER_REGKEY
,
0
,
0
,
REG_OPTION_VOLATILE
,
KEY_ALL_ACCESS
,
0
,
&
volatile_key
,
0
)
!=
ERROR_SUCCESS
)
...
...
@@ -352,18 +358,21 @@ BOOL SYSPARAMS_Save( LPSTR lpRegKey, LPSTR lpValName, LPSTR lpValue,
/***********************************************************************
* SystemParametersInfoA (USER32.@)
*
* Each system parameter has flag which shows whether the parameter
*
Each system parameter has flag which shows whether the parameter
* is loaded or not. Parameters, stored directly in SysParametersInfo are
* loaded from registry only when they are requested and the flag is
* "false", after the loading the flag is set to "true". On interprocess
* notification of the parameter change the corresponding parameter flag is
* set to "false". The parameter value will be reloaded when it is requested
* the next time.
* Parameters, backed by or depend on GetSystemMetrics are processed
*
Parameters, backed by or depend on GetSystemMetrics are processed
* differently. These parameters are always loaded. They are reloaded right
* away on interprocess change notification. We can't do lazy loading because
* we don't want to complicate GetSystemMetrics.
* When parameter value is updated the changed value is stored in permanent
* Parameters, backed by X settings are read from corresponding setting.
* On the parameter change request the setting is changed. Interprocess change
* notifications are ignored.
* When parameter value is updated the changed value is stored in permanent
* registry branch if saving is requested. Otherwise it is stored
* in temporary branch
*
...
...
@@ -462,7 +471,6 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
}
else
ret
=
FALSE
;
break
;
}
...
...
@@ -550,9 +558,10 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
break
;
}
WINE_SPI_WARN
(
SPI_LANGDRIVER
);
/* 12 */
/* not implemented in Windows */
WINE_SPI_WARN
(
SPI_LANGDRIVER
);
/* 12 */
case
SPI_ICONHORIZONTALSPACING
:
/* 13 */
case
SPI_ICONHORIZONTALSPACING
:
/* 13 */
spi_idx
=
SPI_ICONHORIZONTALSPACING_IDX
;
if
(
pvParam
!=
NULL
)
{
...
...
@@ -587,33 +596,56 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
else
ret
=
FALSE
;
}
break
;
case
SPI_GETSCREENSAVETIMEOUT
:
/* 14 */
{
int
timeout
;
timeout
=
USER_Driver
.
pGetScreenSaveTimeout
();
if
(
!
timeout
)
timeout
=
GetProfileIntA
(
"windows"
,
"ScreenSaveTimeout"
,
300
);
*
(
INT
*
)
pvParam
=
timeout
;
case
SPI_GETSCREENSAVETIMEOUT
:
/* 14 */
spi_idx
=
SPI_SETSCREENSAVETIMEOUT_IDX
;
if
(
!
spi_loaded
[
spi_idx
])
{
char
buf
[
10
];
if
(
SYSPARAMS_Load
(
SPI_SETSCREENSAVETIMEOUT_REGKEY
,
SPI_SETSCREENSAVETIMEOUT_VALNAME
,
buf
))
screensave_timeout
=
atoi
(
buf
);
spi_loaded
[
spi_idx
]
=
TRUE
;
}
*
(
INT
*
)
pvParam
=
screensave_timeout
;
break
;
case
SPI_SETSCREENSAVETIMEOUT
:
/* 15 */
{
char
buf
[
10
];
spi_idx
=
SPI_SETSCREENSAVETIMEOUT_IDX
;
sprintf
(
buf
,
"%u"
,
uiParam
);
if
(
SYSPARAMS_Save
(
SPI_SETSCREENSAVETIMEOUT_REGKEY
,
SPI_SETSCREENSAVETIMEOUT_VALNAME
,
buf
,
fWinIni
))
{
screensave_timeout
=
uiParam
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
else
ret
=
FALSE
;
break
;
}
case
SPI_SETSCREENSAVETIMEOUT
:
/* 15 */
USER_Driver
.
pSetScreenSaveTimeout
(
uiParam
);
break
;
case
SPI_GETSCREENSAVEACTIVE
:
/* 16 */
if
(
USER_Driver
.
pGetScreenSaveActive
()
||
GetProfileIntA
(
"windows"
,
"ScreenSaveActive"
,
1
)
==
1
)
*
(
BOOL
*
)
pvParam
=
TRUE
;
else
*
(
BOOL
*
)
pvParam
=
FALSE
;
break
;
case
SPI_SETSCREENSAVEACTIVE
:
/* 17 */
USER_Driver
.
pSetScreenSaveActive
(
uiParam
);
break
;
case
SPI_GETSCREENSAVEACTIVE
:
/* 16 */
*
(
BOOL
*
)
pvParam
=
USER_Driver
.
pGetScreenSaveActive
();
break
;
case
SPI_SETSCREENSAVEACTIVE
:
/* 17 */
{
char
buf
[
5
];
sprintf
(
buf
,
"%u"
,
uiParam
);
USER_Driver
.
pSetScreenSaveActive
(
uiParam
);
break
;
}
case
SPI_GETGRIDGRANULARITY
:
/* 18 */
*
(
INT
*
)
pvParam
=
GetProfileIntA
(
"desktop"
,
"GridGranularity"
,
1
);
break
;
...
...
@@ -1012,8 +1044,26 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
WINE_SPI_FIXME
(
SPI_SETMOUSETRAILS
);
/* 93 WINVER >= 0x400 */
WINE_SPI_FIXME
(
SPI_GETMOUSETRAILS
);
/* 94 WINVER >= 0x400 */
WINE_SPI_FIXME
(
SPI_SETSCREENSAVERRUNNING
);
/* 97 WINVER >= 0x400 */
/* SPI_SCREENSAVERRUNNING is an alias for SPI_SETSCREENSAVERRUNNING */
case
SPI_SETSCREENSAVERRUNNING
:
/* 97 WINVER >= 0x400 */
{
/* SPI_SCREENSAVERRUNNING is an alias for SPI_SETSCREENSAVERRUNNING */
char
buf
[
5
];
spi_idx
=
SPI_SETSCREENSAVERRUNNING_IDX
;
sprintf
(
buf
,
"%u"
,
uiParam
);
/* save only temporarily */
if
(
SYSPARAMS_Save
(
SPI_SETSCREENSAVERRUNNING_REGKEY
,
SPI_SETSCREENSAVERRUNNING_VALNAME
,
buf
,
0
))
{
screensaver_running
=
uiParam
;
spi_loaded
[
spi_idx
]
=
TRUE
;
}
else
ret
=
FALSE
;
break
;
}
case
SPI_GETMOUSEHOVERWIDTH
:
/* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
*
(
UINT
*
)
pvParam
=
4
;
...
...
@@ -1043,6 +1093,21 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
WINE_SPI_FIXME
(
SPI_GETSHOWIMEUI
);
/* 110 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
WINE_SPI_FIXME
(
SPI_SETSHOWIMEUI
);
/* 111 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
case
SPI_GETSCREENSAVERRUNNING
:
/* 114 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
spi_idx
=
SPI_SETSCREENSAVERRUNNING_IDX
;
if
(
!
spi_loaded
[
spi_idx
])
{
char
buf
[
5
];
if
(
SYSPARAMS_Load
(
SPI_SETSCREENSAVERRUNNING_REGKEY
,
SPI_SETSCREENSAVERRUNNING_VALNAME
,
buf
))
screensaver_running
=
atoi
(
buf
);
spi_loaded
[
spi_idx
]
=
TRUE
;
}
*
(
BOOL
*
)
pvParam
=
screensaver_running
;
break
;
default:
FIXME
(
"Unknown action: %u
\n
"
,
uiAction
);
SetLastError
(
ERROR_INVALID_SPI_VALUE
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment