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
4c71db15
Commit
4c71db15
authored
Mar 30, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Set the process DPI awareness from the manifest.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bd0cd09e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
user_main.c
dlls/user32/user_main.c
+57
-0
user_private.h
dlls/user32/user_private.h
+2
-0
No files found.
dlls/user32/user_main.c
View file @
4c71db15
...
...
@@ -212,6 +212,62 @@ static const WCHAR *get_default_desktop(void)
/***********************************************************************
* dpiaware_init
*
* Initialize the DPI awareness style.
*/
static
void
dpiaware_init
(
void
)
{
WCHAR
buffer
[
256
];
static
const
WCHAR
dpiAwareW
[]
=
{
'd'
,
'p'
,
'i'
,
'A'
,
'w'
,
'a'
,
'r'
,
'e'
,
0
};
static
const
WCHAR
dpiAwarenessW
[]
=
{
'd'
,
'p'
,
'i'
,
'A'
,
'w'
,
'a'
,
'r'
,
'e'
,
'n'
,
'e'
,
's'
,
's'
,
0
};
static
const
WCHAR
namespace2005W
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
's'
,
'c'
,
'h'
,
'e'
,
'm'
,
'a'
,
's'
,
'.'
,
'm'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'.'
,
'c'
,
'o'
,
'm'
,
'/'
,
'S'
,
'M'
,
'I'
,
'/'
,
'2'
,
'0'
,
'0'
,
'5'
,
'/'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'S'
,
'e'
,
't'
,
't'
,
'i'
,
'n'
,
'g'
,
's'
,
0
};
static
const
WCHAR
namespace2016W
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
's'
,
'c'
,
'h'
,
'e'
,
'm'
,
'a'
,
's'
,
'.'
,
'm'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'.'
,
'c'
,
'o'
,
'm'
,
'/'
,
'S'
,
'M'
,
'I'
,
'/'
,
'2'
,
'0'
,
'1'
,
'6'
,
'/'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'S'
,
'e'
,
't'
,
't'
,
'i'
,
'n'
,
'g'
,
's'
,
0
};
if
(
QueryActCtxSettingsW
(
0
,
NULL
,
namespace2016W
,
dpiAwarenessW
,
buffer
,
ARRAY_SIZE
(
buffer
),
NULL
))
{
static
const
WCHAR
unawareW
[]
=
{
'u'
,
'n'
,
'a'
,
'w'
,
'a'
,
'r'
,
'e'
,
0
};
static
const
WCHAR
systemW
[]
=
{
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
0
};
static
const
WCHAR
permonW
[]
=
{
'p'
,
'e'
,
'r'
,
'm'
,
'o'
,
'n'
,
'i'
,
't'
,
'o'
,
'r'
,
0
};
static
const
WCHAR
permonv2W
[]
=
{
'p'
,
'e'
,
'r'
,
'm'
,
'o'
,
'n'
,
'i'
,
't'
,
'o'
,
'r'
,
'v'
,
'2'
,
0
};
static
const
WCHAR
spacesW
[]
=
{
' '
,
'\t'
,
'\r'
,
'\n'
,
0
};
static
const
WCHAR
*
const
types
[]
=
{
unawareW
,
systemW
,
permonW
,
permonv2W
};
WCHAR
*
p
,
*
start
=
buffer
,
*
end
;
ULONG_PTR
i
;
TRACE
(
"got dpiAwareness=%s
\n
"
,
debugstr_w
(
buffer
)
);
for
(
start
=
buffer
;
*
start
;
start
=
end
)
{
start
+=
strspnW
(
start
,
spacesW
);
if
(
!
(
end
=
strchrW
(
start
,
','
)))
end
=
start
+
strlenW
(
start
);
else
*
end
++
=
0
;
if
((
p
=
strpbrkW
(
start
,
spacesW
)))
*
p
=
0
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
types
);
i
++
)
{
if
(
strcmpiW
(
start
,
types
[
i
]
))
continue
;
SetProcessDpiAwarenessContext
(
(
DPI_AWARENESS_CONTEXT
)
~
i
);
return
;
}
}
}
else
if
(
QueryActCtxSettingsW
(
0
,
NULL
,
namespace2005W
,
dpiAwareW
,
buffer
,
ARRAY_SIZE
(
buffer
),
NULL
))
{
static
const
WCHAR
trueW
[]
=
{
't'
,
'r'
,
'u'
,
'e'
,
0
};
static
const
WCHAR
truepmW
[]
=
{
't'
,
'r'
,
'u'
,
'e'
,
'/'
,
'p'
,
'm'
,
0
};
static
const
WCHAR
permonW
[]
=
{
'p'
,
'e'
,
'r'
,
' '
,
'm'
,
'o'
,
'n'
,
'i'
,
't'
,
'o'
,
'r'
,
0
};
TRACE
(
"got dpiAware=%s
\n
"
,
debugstr_w
(
buffer
)
);
if
(
!
strcmpiW
(
buffer
,
trueW
))
SetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
);
else
if
(
!
strcmpiW
(
buffer
,
truepmW
)
||
!
strcmpiW
(
buffer
,
permonW
))
SetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
);
else
SetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_UNAWARE
);
}
}
/***********************************************************************
* winstation_init
*
* Connect to the process window station and desktop.
...
...
@@ -272,6 +328,7 @@ static void winstation_init(void)
*/
static
BOOL
process_attach
(
void
)
{
dpiaware_init
();
winstation_init
();
/* Initialize system colors and metrics */
...
...
dlls/user32/user_private.h
View file @
4c71db15
...
...
@@ -32,6 +32,8 @@
#define GET_WORD(ptr) (*(const WORD *)(ptr))
#define GET_DWORD(ptr) (*(const DWORD *)(ptr))
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#define WM_SYSTIMER 0x0118
#define WM_POPUPSYSTEMMENU 0x0313
...
...
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