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
a12f1532
Commit
a12f1532
authored
Oct 23, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Adapt system metrics for multi-monitor setups.
parent
9d6d54f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
8 deletions
+54
-8
sysparams.c
dlls/user/sysparams.c
+52
-6
sysparams.c
dlls/user/tests/sysparams.c
+2
-2
No files found.
dlls/user/sysparams.c
View file @
a12f1532
...
...
@@ -488,6 +488,31 @@ static void SYSPARAMS_NonClientMetrics32ATo32W( const NONCLIENTMETRICSA* lpnm32A
SYSPARAMS_LogFont32ATo32W
(
&
lpnm32A
->
lfMessageFont
,
&
lpnm32W
->
lfMessageFont
);
}
/* Helper functions to retrieve monitors info */
struct
monitor_info
{
int
count
;
RECT
virtual_rect
;
};
static
BOOL
CALLBACK
monitor_info_proc
(
HMONITOR
monitor
,
HDC
hdc
,
LPRECT
rect
,
LPARAM
lp
)
{
struct
monitor_info
*
info
=
(
struct
monitor_info
*
)
lp
;
info
->
count
++
;
UnionRect
(
&
info
->
virtual_rect
,
&
info
->
virtual_rect
,
rect
);
return
TRUE
;
}
static
void
get_monitors_info
(
struct
monitor_info
*
info
)
{
info
->
count
=
0
;
SetRectEmpty
(
&
info
->
virtual_rect
);
EnumDisplayMonitors
(
0
,
NULL
,
monitor_info_proc
,
(
LPARAM
)
info
);
}
/* get text metrics and/or "average" char width of the specified logfont
* for the specified dc */
static
void
get_text_metr_size
(
HDC
hdc
,
LOGFONTW
*
plf
,
TEXTMETRICW
*
ptm
,
UINT
*
psz
)
...
...
@@ -2677,9 +2702,9 @@ INT WINAPI GetSystemMetrics( INT index )
if
(
!
spi_loaded
[
SPI_NONCLIENTMETRICS_IDX
])
load_nonclient_metrics
();
return
nonclient_metrics
.
iCaptionHeight
+
6
;
case
SM_CXMAXTRACK
:
return
GetSystemMetrics
(
SM_CXSCREEN
)
+
4
+
2
*
GetSystemMetrics
(
SM_CXFRAME
);
return
GetSystemMetrics
(
SM_CX
VIRTUAL
SCREEN
)
+
4
+
2
*
GetSystemMetrics
(
SM_CXFRAME
);
case
SM_CYMAXTRACK
:
return
GetSystemMetrics
(
SM_CYSCREEN
)
+
4
+
2
*
GetSystemMetrics
(
SM_CYFRAME
);
return
GetSystemMetrics
(
SM_CY
VIRTUAL
SCREEN
)
+
4
+
2
*
GetSystemMetrics
(
SM_CYFRAME
);
case
SM_CXMAXIMIZED
:
/* FIXME: subtract the width of any vertical application toolbars*/
return
GetSystemMetrics
(
SM_CXSCREEN
)
+
2
*
GetSystemMetrics
(
SM_CXFRAME
);
...
...
@@ -2708,14 +2733,35 @@ INT WINAPI GetSystemMetrics( INT index )
case
SM_MOUSEWHEELPRESENT
:
return
1
;
case
SM_XVIRTUALSCREEN
:
{
struct
monitor_info
info
;
get_monitors_info
(
&
info
);
return
info
.
virtual_rect
.
left
;
}
case
SM_YVIRTUALSCREEN
:
return
0
;
{
struct
monitor_info
info
;
get_monitors_info
(
&
info
);
return
info
.
virtual_rect
.
top
;
}
case
SM_CXVIRTUALSCREEN
:
return
GetSystemMetrics
(
SM_CXSCREEN
);
{
struct
monitor_info
info
;
get_monitors_info
(
&
info
);
return
info
.
virtual_rect
.
right
-
info
.
virtual_rect
.
left
;
}
case
SM_CYVIRTUALSCREEN
:
return
GetSystemMetrics
(
SM_CYSCREEN
);
{
struct
monitor_info
info
;
get_monitors_info
(
&
info
);
return
info
.
virtual_rect
.
bottom
-
info
.
virtual_rect
.
top
;
}
case
SM_CMONITORS
:
return
1
;
{
struct
monitor_info
info
;
get_monitors_info
(
&
info
);
return
info
.
count
;
}
case
SM_SAMEDISPLAYFORMAT
:
return
1
;
case
SM_IMMENABLED
:
...
...
dlls/user/tests/sysparams.c
View file @
a12f1532
...
...
@@ -2384,9 +2384,9 @@ void test_GetSystemMetrics( void)
/* SM_ARRANGE */
ok_gsm
(
SM_CXMINIMIZED
,
minim
.
iWidth
+
6
);
ok_gsm
(
SM_CYMINIMIZED
,
GetSystemMetrics
(
SM_CYCAPTION
)
+
5
);
ok_gsm
(
SM_CXMAXTRACK
,
GetSystemMetrics
(
SM_CXSCREEN
)
+
ok_gsm
(
SM_CXMAXTRACK
,
GetSystemMetrics
(
SM_CX
VIRTUAL
SCREEN
)
+
4
+
2
*
GetSystemMetrics
(
SM_CXFRAME
));
ok_gsm
(
SM_CYMAXTRACK
,
GetSystemMetrics
(
SM_CYSCREEN
)
+
ok_gsm
(
SM_CYMAXTRACK
,
GetSystemMetrics
(
SM_CY
VIRTUAL
SCREEN
)
+
4
+
2
*
GetSystemMetrics
(
SM_CYFRAME
));
/* the next two cannot really be tested as they depend on (application)
* toolbars */
...
...
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