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
8a70b70f
Commit
8a70b70f
authored
May 15, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Update the window DPI awareness in SetParent().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43378873
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
3 deletions
+28
-3
sysparams.c
dlls/user32/tests/sysparams.c
+17
-1
win.c
dlls/user32/win.c
+1
-0
server_protocol.h
include/wine/server_protocol.h
+3
-1
protocol.def
server/protocol.def
+1
-0
request.h
server/request.h
+2
-1
trace.c
server/trace.c
+1
-0
window.c
server/window.c
+3
-0
No files found.
dlls/user32/tests/sysparams.c
View file @
8a70b70f
...
...
@@ -3526,7 +3526,7 @@ static void test_dpi_window(void)
DPI_AWARENESS_CONTEXT
context
,
orig
;
DPI_AWARENESS
awareness
;
ULONG_PTR
i
,
j
;
HWND
hwnd
,
child
;
HWND
hwnd
,
child
,
ret
;
MSG
msg
=
{
0
,
WM_USER
+
1
,
0
,
0
};
if
(
!
pGetWindowDpiAwarenessContext
)
...
...
@@ -3556,6 +3556,22 @@ static void test_dpi_window(void)
context
=
pGetWindowDpiAwarenessContext
(
child
);
awareness
=
pGetAwarenessFromDpiAwarenessContext
(
context
);
ok
(
awareness
==
i
,
"%lu/%lu: wrong awareness %u
\n
"
,
i
,
j
,
awareness
);
ret
=
SetParent
(
child
,
NULL
);
ok
(
ret
!=
0
,
"SetParent failed err %u
\n
"
,
GetLastError
()
);
context
=
pGetWindowDpiAwarenessContext
(
child
);
awareness
=
pGetAwarenessFromDpiAwarenessContext
(
context
);
ok
(
awareness
==
i
,
"%lu/%lu: wrong awareness %u
\n
"
,
i
,
j
,
awareness
);
DestroyWindow
(
child
);
child
=
CreateWindowA
(
"DpiTestClass"
,
"Test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
100
,
100
,
0
,
0
,
GetModuleHandleA
(
0
),
NULL
);
context
=
pGetWindowDpiAwarenessContext
(
child
);
awareness
=
pGetAwarenessFromDpiAwarenessContext
(
context
);
ok
(
awareness
==
j
,
"%lu/%lu: wrong awareness %u
\n
"
,
i
,
j
,
awareness
);
ret
=
SetParent
(
child
,
hwnd
);
ok
(
ret
!=
0
,
"SetParent failed err %u
\n
"
,
GetLastError
()
);
context
=
pGetWindowDpiAwarenessContext
(
child
);
awareness
=
pGetAwarenessFromDpiAwarenessContext
(
context
);
ok
(
awareness
==
i
,
"%lu/%lu: wrong awareness %u
\n
"
,
i
,
j
,
awareness
);
DestroyWindow
(
child
);
}
DestroyWindow
(
hwnd
);
...
...
dlls/user32/win.c
View file @
8a70b70f
...
...
@@ -3083,6 +3083,7 @@ HWND WINAPI SetParent( HWND hwnd, HWND parent )
{
old_parent
=
wine_server_ptr_handle
(
reply
->
old_parent
);
wndPtr
->
parent
=
parent
=
wine_server_ptr_handle
(
reply
->
full_parent
);
wndPtr
->
dpi_awareness
=
reply
->
awareness
;
}
}
...
...
include/wine/server_protocol.h
View file @
8a70b70f
...
...
@@ -3571,6 +3571,8 @@ struct set_parent_reply
struct
reply_header
__header
;
user_handle_t
old_parent
;
user_handle_t
full_parent
;
int
awareness
;
char
__pad_20
[
4
];
};
...
...
@@ -6507,6 +6509,6 @@ union generic_reply
struct
terminate_job_reply
terminate_job_reply
;
};
#define SERVER_PROTOCOL_VERSION 5
49
#define SERVER_PROTOCOL_VERSION 5
50
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
8a70b70f
...
...
@@ -2564,6 +2564,7 @@ enum message_type
@REPLY
user_handle_t old_parent; /* old parent window */
user_handle_t full_parent; /* full handle of new parent */
int awareness; /* new DPI awareness */
@END
...
...
server/request.h
View file @
8a70b70f
...
...
@@ -1717,7 +1717,8 @@ C_ASSERT( FIELD_OFFSET(struct set_parent_request, parent) == 16 );
C_ASSERT
(
sizeof
(
struct
set_parent_request
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_parent_reply
,
old_parent
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_parent_reply
,
full_parent
)
==
12
);
C_ASSERT
(
sizeof
(
struct
set_parent_reply
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
set_parent_reply
,
awareness
)
==
16
);
C_ASSERT
(
sizeof
(
struct
set_parent_reply
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_window_parents_request
,
handle
)
==
12
);
C_ASSERT
(
sizeof
(
struct
get_window_parents_request
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_window_parents_reply
,
count
)
==
8
);
...
...
server/trace.c
View file @
8a70b70f
...
...
@@ -3131,6 +3131,7 @@ static void dump_set_parent_reply( const struct set_parent_reply *req )
{
fprintf
(
stderr
,
" old_parent=%08x"
,
req
->
old_parent
);
fprintf
(
stderr
,
", full_parent=%08x"
,
req
->
full_parent
);
fprintf
(
stderr
,
", awareness=%d"
,
req
->
awareness
);
}
static
void
dump_get_window_parents_request
(
const
struct
get_window_parents_request
*
req
)
...
...
server/window.c
View file @
8a70b70f
...
...
@@ -250,6 +250,8 @@ static int set_parent_window( struct window *win, struct window *parent )
win
->
parent
=
parent
;
link_window
(
win
,
WINPTR_TOP
);
if
(
!
is_desktop_window
(
parent
))
win
->
dpi_awareness
=
parent
->
dpi_awareness
;
/* if parent belongs to a different thread and the window isn't */
/* top-level, attach the two threads */
if
(
parent
->
thread
&&
parent
->
thread
!=
win
->
thread
&&
!
is_desktop_window
(
parent
))
...
...
@@ -1939,6 +1941,7 @@ DECL_HANDLER(set_parent)
reply
->
old_parent
=
win
->
parent
->
handle
;
reply
->
full_parent
=
parent
?
parent
->
handle
:
0
;
set_parent_window
(
win
,
parent
);
reply
->
awareness
=
win
->
dpi_awareness
;
}
...
...
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