Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
56dfe670
Commit
56dfe670
authored
Jul 16, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Retrieve the screen metrics from the monitor information.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1373e004
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
29 deletions
+21
-29
sysparams.c
dlls/user32/sysparams.c
+21
-29
No files found.
dlls/user32/sysparams.c
View file @
56dfe670
...
...
@@ -458,20 +458,26 @@ static void SYSPARAMS_NonClientMetrics32ATo32W( const NONCLIENTMETRICSA* lpnm32A
struct
monitor_info
{
int
count
;
RECT
primary_rect
;
RECT
virtual_rect
;
};
static
BOOL
CALLBACK
monitor_info_proc
(
HMONITOR
monitor
,
HDC
hdc
,
LPRECT
rect
,
LPARAM
lp
)
{
MONITORINFO
mi
;
struct
monitor_info
*
info
=
(
struct
monitor_info
*
)
lp
;
info
->
count
++
;
UnionRect
(
&
info
->
virtual_rect
,
&
info
->
virtual_rect
,
rect
);
mi
.
cbSize
=
sizeof
(
mi
);
if
(
GetMonitorInfoW
(
monitor
,
&
mi
)
&&
(
mi
.
dwFlags
&
MONITORINFOF_PRIMARY
))
info
->
primary_rect
=
mi
.
rcMonitor
;
return
TRUE
;
}
static
void
get_monitors_info
(
struct
monitor_info
*
info
)
{
info
->
count
=
0
;
SetRectEmpty
(
&
info
->
primary_rect
);
SetRectEmpty
(
&
info
->
virtual_rect
);
EnumDisplayMonitors
(
0
,
NULL
,
monitor_info_proc
,
(
LPARAM
)
info
);
}
...
...
@@ -2527,6 +2533,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
*/
INT
WINAPI
GetSystemMetrics
(
INT
index
)
{
struct
monitor_info
info
;
NONCLIENTMETRICSW
ncm
;
MINIMIZEDMETRICS
mm
;
ICONMETRICSW
im
;
...
...
@@ -2536,16 +2543,6 @@ INT WINAPI GetSystemMetrics( INT index )
/* some metrics are dynamic */
switch
(
index
)
{
case
SM_CXSCREEN
:
hdc
=
get_display_dc
();
ret
=
GetDeviceCaps
(
hdc
,
HORZRES
);
release_display_dc
(
hdc
);
return
ret
;
case
SM_CYSCREEN
:
hdc
=
get_display_dc
();
ret
=
GetDeviceCaps
(
hdc
,
VERTRES
);
release_display_dc
(
hdc
);
return
ret
;
case
SM_CXVSCROLL
:
case
SM_CYHSCROLL
:
ncm
.
cbSize
=
sizeof
(
ncm
);
...
...
@@ -2749,32 +2746,27 @@ INT WINAPI GetSystemMetrics( INT index )
return
0
;
/* FIXME */
case
SM_MOUSEWHEELPRESENT
:
return
1
;
case
SM_CXSCREEN
:
get_monitors_info
(
&
info
);
return
info
.
primary_rect
.
right
-
info
.
primary_rect
.
left
;
case
SM_CYSCREEN
:
get_monitors_info
(
&
info
);
return
info
.
primary_rect
.
bottom
-
info
.
primary_rect
.
top
;
case
SM_XVIRTUALSCREEN
:
{
RECT
rect
=
get_virtual_screen_rect
();
return
rect
.
left
;
}
get_monitors_info
(
&
info
);
return
info
.
virtual_rect
.
left
;
case
SM_YVIRTUALSCREEN
:
{
RECT
rect
=
get_virtual_screen_rect
();
return
rect
.
top
;
}
get_monitors_info
(
&
info
);
return
info
.
virtual_rect
.
top
;
case
SM_CXVIRTUALSCREEN
:
{
RECT
rect
=
get_virtual_screen_rect
();
return
rect
.
right
-
rect
.
left
;
}
get_monitors_info
(
&
info
);
return
info
.
virtual_rect
.
right
-
info
.
virtual_rect
.
left
;
case
SM_CYVIRTUALSCREEN
:
{
RECT
rect
=
get_virtual_screen_rect
();
return
rect
.
bottom
-
rect
.
top
;
}
get_monitors_info
(
&
info
);
return
info
.
virtual_rect
.
bottom
-
info
.
virtual_rect
.
top
;
case
SM_CMONITORS
:
{
struct
monitor_info
info
;
get_monitors_info
(
&
info
);
return
info
.
count
;
}
case
SM_SAMEDISPLAYFORMAT
:
return
1
;
case
SM_IMMENABLED
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment