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
0ce293a0
Commit
0ce293a0
authored
Apr 11, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Apr 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Correctly restore the caption sizes when run in DPI scaling mode.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9b9316cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
sysparams.c
dlls/user32/tests/sysparams.c
+19
-2
No files found.
dlls/user32/tests/sysparams.c
View file @
0ce293a0
...
...
@@ -41,7 +41,7 @@
static
LONG
(
WINAPI
*
pChangeDisplaySettingsExA
)(
LPCSTR
,
LPDEVMODEA
,
HWND
,
DWORD
,
LPVOID
);
static
BOOL
strict
;
static
int
dpi
;
static
int
dpi
,
real_dpi
;
static
BOOL
iswin9x
;
static
HDC
hdc
;
...
...
@@ -165,6 +165,19 @@ static int last_bpp;
static
BOOL
displaychange_ok
=
FALSE
,
displaychange_test_active
=
FALSE
;
static
HANDLE
displaychange_sem
=
0
;
static
int
get_real_dpi
(
void
)
{
HKEY
key
;
DWORD
value
=
USER_DEFAULT_SCREEN_DPI
,
size
=
sizeof
(
value
);
if
(
!
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Control Panel
\\
Desktop"
,
&
key
))
{
RegQueryValueExA
(
key
,
"LogPixels"
,
NULL
,
NULL
,
(
BYTE
*
)
&
value
,
&
size
);
RegCloseKey
(
key
);
}
return
value
;
}
static
LRESULT
CALLBACK
SysParamsTestWndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
...
...
@@ -1475,12 +1488,14 @@ static void test_SPI_SETNONCLIENTMETRICS( void ) /* 44 */
the caption font height is higher than the CaptionHeight field,
the latter is adjusted accordingly. To be able to restore these setting
accurately be restore the raw values. */
Ncmorig
.
iCaptionWidth
=
metricfromreg
(
SPI_METRIC_REGKEY
,
SPI_CAPTIONWIDTH_VALNAME
,
dpi
);
Ncmorig
.
iCaptionWidth
=
metricfromreg
(
SPI_METRIC_REGKEY
,
SPI_CAPTIONWIDTH_VALNAME
,
real_
dpi
);
Ncmorig
.
iCaptionHeight
=
metricfromreg
(
SPI_METRIC_REGKEY
,
SPI_CAPTIONHEIGHT_VALNAME
,
dpi
);
Ncmorig
.
iSmCaptionHeight
=
metricfromreg
(
SPI_METRIC_REGKEY
,
SPI_SMCAPTIONHEIGHT_VALNAME
,
dpi
);
Ncmorig
.
iMenuHeight
=
metricfromreg
(
SPI_METRIC_REGKEY
,
SPI_MENUHEIGHT_VALNAME
,
dpi
);
/* test registry entries */
TEST_NONCLIENTMETRICS_REG
(
Ncmorig
)
Ncmorig
.
lfCaptionFont
.
lfHeight
=
MulDiv
(
Ncmorig
.
lfCaptionFont
.
lfHeight
,
real_dpi
,
dpi
);
/* make small changes */
Ncmnew
=
Ncmstart
;
Ncmnew
.
iBorderWidth
+=
1
;
...
...
@@ -2933,6 +2948,8 @@ START_TEST(sysparams)
hInstance
=
GetModuleHandleA
(
NULL
);
hdc
=
GetDC
(
0
);
dpi
=
GetDeviceCaps
(
hdc
,
LOGPIXELSY
);
real_dpi
=
get_real_dpi
();
trace
(
"dpi %d real_dpi %d
\n
"
,
dpi
,
real_dpi
);
iswin9x
=
GetVersion
()
&
0x80000000
;
/* This test requires interactivity, if we don't have it, give up */
...
...
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