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
31967ef5
Commit
31967ef5
authored
Apr 12, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Take DPI awareness into account for the LOGPIXELSX/Y device caps.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
74a9c919
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
5 deletions
+20
-5
driver.c
dlls/gdi32/driver.c
+1
-4
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-0
gdiobj.c
dlls/gdi32/gdiobj.c
+18
-0
sysparams.c
dlls/user32/tests/sysparams.c
+0
-1
No files found.
dlls/gdi32/driver.c
View file @
31967ef5
...
...
@@ -298,7 +298,6 @@ static BOOL nulldrv_GetCharWidth( PHYSDEV dev, UINT first, UINT last, INT *buffe
static
INT
nulldrv_GetDeviceCaps
(
PHYSDEV
dev
,
INT
cap
)
{
static
int
screen_dpi
;
int
bpp
;
switch
(
cap
)
...
...
@@ -351,9 +350,7 @@ static INT nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
case
SHADEBLENDCAPS
:
return
0
;
case
COLORMGMTCAPS
:
return
0
;
case
LOGPIXELSX
:
case
LOGPIXELSY
:
if
(
!
screen_dpi
&&
!
(
screen_dpi
=
get_dpi
()))
screen_dpi
=
96
;
return
screen_dpi
;
case
LOGPIXELSY
:
return
get_system_dpi
();
case
NUMCOLORS
:
bpp
=
GetDeviceCaps
(
dev
->
hdc
,
BITSPIXEL
);
return
(
bpp
>
8
)
?
-
1
:
(
1
<<
bpp
);
...
...
dlls/gdi32/gdi_private.h
View file @
31967ef5
...
...
@@ -304,6 +304,7 @@ extern BOOL GDI_dec_ref_count( HGDIOBJ handle ) DECLSPEC_HIDDEN;
extern
void
GDI_hdc_using_object
(
HGDIOBJ
obj
,
HDC
hdc
)
DECLSPEC_HIDDEN
;
extern
void
GDI_hdc_not_using_object
(
HGDIOBJ
obj
,
HDC
hdc
)
DECLSPEC_HIDDEN
;
extern
DWORD
get_dpi
(
void
)
DECLSPEC_HIDDEN
;
extern
DWORD
get_system_dpi
(
void
)
DECLSPEC_HIDDEN
;
/* mapping.c */
extern
BOOL
dp_to_lp
(
DC
*
dc
,
POINT
*
points
,
INT
count
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/gdiobj.c
View file @
31967ef5
...
...
@@ -641,6 +641,24 @@ DWORD get_dpi(void)
return
0
;
}
/******************************************************************************
* get_system_dpi
*
* Get the system DPI, based on the DPI awareness mode.
*/
DWORD
get_system_dpi
(
void
)
{
static
UINT
(
WINAPI
*
pGetDpiForSystem
)(
void
);
if
(
!
pGetDpiForSystem
)
{
static
const
WCHAR
user32W
[]
=
{
'u'
,
's'
,
'e'
,
'r'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
HMODULE
user
=
GetModuleHandleW
(
user32W
);
if
(
user
)
pGetDpiForSystem
=
(
void
*
)
GetProcAddress
(
user
,
"GetDpiForSystem"
);
}
return
pGetDpiForSystem
?
pGetDpiForSystem
()
:
96
;
}
static
HFONT
create_scaled_font
(
const
LOGFONTW
*
deffont
)
{
LOGFONTW
lf
;
...
...
dlls/user32/tests/sysparams.c
View file @
31967ef5
...
...
@@ -3091,7 +3091,6 @@ static void test_dpi_aware(void)
dpi
=
pGetDpiForSystem
();
ok
(
dpi
==
USER_DEFAULT_SCREEN_DPI
,
"wrong dpi %u
\n
"
,
dpi
);
dpi
=
GetDeviceCaps
(
hdc
,
LOGPIXELSX
);
todo_wine_if
(
real_dpi
!=
USER_DEFAULT_SCREEN_DPI
)
ok
(
dpi
==
USER_DEFAULT_SCREEN_DPI
,
"wrong dpi %u
\n
"
,
dpi
);
ok
(
!
pIsProcessDPIAware
(),
"still aware
\n
"
);
context
=
pGetThreadDpiAwarenessContext
();
...
...
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