Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d645c6ff
Commit
d645c6ff
authored
Apr 27, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Apr 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Try to read the dpi from the user key first.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
39b467da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
15 deletions
+34
-15
init.c
dlls/winex11.drv/init.c
+34
-15
No files found.
dlls/winex11.drv/init.c
View file @
d645c6ff
...
...
@@ -42,35 +42,51 @@ static Pixmap stock_bitmap_pixmap; /* phys bitmap for the default stock bitmap
static
INIT_ONCE
init_once
=
INIT_ONCE_STATIC_INIT
;
static
const
WCHAR
dpi_key_name
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'\0'
};
static
const
WCHAR
dpi_key_name
[]
=
{
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
' '
,
'P'
,
'a'
,
'n'
,
'e'
,
'l'
,
'\\'
,
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
'\0'
};
static
const
WCHAR
def_dpi_key_name
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'F'
,
'o'
,
'n'
,
't'
,
's'
,
'\0'
};
static
const
WCHAR
dpi_value_name
[]
=
{
'L'
,
'o'
,
'g'
,
'P'
,
'i'
,
'x'
,
'e'
,
'l'
,
's'
,
'\0'
};
static
const
struct
gdi_dc_funcs
x11drv_funcs
;
static
const
struct
gdi_dc_funcs
*
xrender_funcs
;
/******************************************************************************
*
get_dpi
*
get_reg_dword
*
*
get the dpi
from the registry
*
Read a DWORD value
from the registry
*/
static
DWORD
get_dpi
(
void
)
static
BOOL
get_reg_dword
(
HKEY
base
,
const
WCHAR
*
key_name
,
const
WCHAR
*
value_name
,
DWORD
*
value
)
{
DWORD
dpi
=
96
;
HKEY
hkey
;
HKEY
key
;
DWORD
type
,
data
,
size
=
sizeof
(
data
);
BOOL
ret
=
FALSE
;
if
(
RegOpenKeyW
(
HKEY_CURRENT_CONFIG
,
dpi_key_name
,
&
h
key
)
==
ERROR_SUCCESS
)
if
(
RegOpenKeyW
(
base
,
key_name
,
&
key
)
==
ERROR_SUCCESS
)
{
DWORD
type
,
size
,
new_dpi
;
size
=
sizeof
(
new_dpi
);
if
(
RegQueryValueExW
(
hkey
,
dpi_value_name
,
NULL
,
&
type
,
(
void
*
)
&
new_dpi
,
&
size
)
==
ERROR_SUCCESS
)
if
(
RegQueryValueExW
(
key
,
value_name
,
NULL
,
&
type
,
(
void
*
)
&
data
,
&
size
)
==
ERROR_SUCCESS
&&
type
==
REG_DWORD
)
{
if
(
type
==
REG_DWORD
&&
new_dpi
!=
0
)
dpi
=
new_dpi
;
*
value
=
data
;
ret
=
TRUE
;
}
RegCloseKey
(
h
key
);
RegCloseKey
(
key
);
}
return
dpi
;
return
ret
;
}
/******************************************************************************
* get_dpi
*
* get the dpi from the registry
*/
static
DWORD
get_dpi
(
void
)
{
DWORD
dpi
;
if
(
get_reg_dword
(
HKEY_CURRENT_USER
,
dpi_key_name
,
dpi_value_name
,
&
dpi
))
return
dpi
;
if
(
get_reg_dword
(
HKEY_CURRENT_CONFIG
,
def_dpi_key_name
,
dpi_value_name
,
&
dpi
))
return
dpi
;
return
0
;
}
/**********************************************************************
...
...
@@ -92,6 +108,9 @@ static BOOL WINAPI device_init( INIT_ONCE *once, void *param, void **context )
/* Initialize device caps */
log_pixels_x
=
log_pixels_y
=
get_dpi
();
if
(
!
log_pixels_x
)
log_pixels_x
=
log_pixels_y
=
USER_DEFAULT_SCREEN_DPI
;
return
TRUE
;
}
...
...
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