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
a5256319
Commit
a5256319
authored
Aug 28, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Scale dialog base units based on DPI awareness.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
19c364bd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
dialog.c
dlls/user32/dialog.c
+7
-7
sysparams.c
dlls/user32/tests/sysparams.c
+9
-1
No files found.
dlls/user32/dialog.c
View file @
a5256319
...
...
@@ -1505,22 +1505,22 @@ BOOL WINAPI CheckRadioButton( HWND hwndDlg, int firstID,
*/
DWORD
WINAPI
GetDialogBaseUnits
(
void
)
{
static
DWORD
units
;
static
LONG
cx
,
cy
;
if
(
!
units
)
if
(
!
cx
)
{
HDC
hdc
;
SIZE
size
;
if
((
hdc
=
GetDC
(
0
)))
{
size
.
cx
=
GdiGetCharDimensions
(
hdc
,
NULL
,
&
size
.
cy
);
if
(
size
.
cx
)
units
=
MAKELONG
(
size
.
cx
,
size
.
cy
);
cx
=
GdiGetCharDimensions
(
hdc
,
NULL
,
&
cy
);
ReleaseDC
(
0
,
hdc
);
}
TRACE
(
"base units = %d,%d
\n
"
,
LOWORD
(
units
),
HIWORD
(
units
)
);
TRACE
(
"base units = %d,%d
\n
"
,
cx
,
cy
);
}
return
units
;
return
MAKELONG
(
MulDiv
(
cx
,
GetDpiForSystem
(),
USER_DEFAULT_SCREEN_DPI
),
MulDiv
(
cy
,
GetDpiForSystem
(),
USER_DEFAULT_SCREEN_DPI
));
}
...
...
dlls/user32/tests/sysparams.c
View file @
a5256319
...
...
@@ -3217,7 +3217,7 @@ static void test_dpi_mapping(void)
{
HWND
hwnd
,
child
;
HDC
hdc
;
UINT
win_dpi
;
UINT
win_dpi
,
units
;
POINT
point
;
BOOL
ret
;
HRGN
rgn
,
update
;
...
...
@@ -3292,6 +3292,7 @@ static void test_dpi_mapping(void)
ShowWindow
(
hwnd
,
SW_MINIMIZE
);
ShowWindow
(
hwnd
,
SW_RESTORE
);
GetWindowPlacement
(
hwnd
,
&
wpl_orig
);
units
=
GetDialogBaseUnits
();
for
(
j
=
DPI_AWARENESS_UNAWARE
;
j
<=
DPI_AWARENESS_PER_MONITOR_AWARE
;
j
++
)
{
...
...
@@ -3407,6 +3408,13 @@ static void test_dpi_mapping(void)
i
,
j
,
wine_dbgstr_rect
(
&
rect
),
wine_dbgstr_rect
(
&
expect
)
);
UpdateWindow
(
hwnd
);
DeleteObject
(
update
);
/* test dialog units */
ret
=
GetDialogBaseUnits
();
point
.
x
=
LOWORD
(
units
);
point
.
y
=
HIWORD
(
units
);
scale_point_dpi_aware
(
&
point
,
i
,
j
);
ok
(
LOWORD
(
ret
)
==
point
.
x
&&
HIWORD
(
ret
)
==
point
.
y
,
"%lu/%lu: wrong units %d,%d / %d,%d
\n
"
,
i
,
j
,
LOWORD
(
ret
),
HIWORD
(
ret
),
point
.
x
,
point
.
y
);
/* test window points mapping */
SetRect
(
&
rect
,
0
,
0
,
100
,
100
);
rect
.
right
=
rect
.
left
+
100
;
...
...
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