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
5b9c69b9
Commit
5b9c69b9
authored
Jul 13, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Copy the bits of child windows when the parent has a surface.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4e13c06f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
4 deletions
+68
-4
painting.c
dlls/user32/painting.c
+35
-0
user_private.h
dlls/user32/user_private.h
+2
-0
winpos.c
dlls/user32/winpos.c
+31
-4
No files found.
dlls/user32/painting.c
View file @
5b9c69b9
...
...
@@ -811,6 +811,41 @@ void move_window_bits( HWND hwnd, struct window_surface *old_surface,
/***********************************************************************
* move_window_bits_parent
*
* Move the window bits in the parent surface when a child is moved.
*/
void
move_window_bits_parent
(
HWND
hwnd
,
HWND
parent
,
const
RECT
*
window_rect
,
const
RECT
*
valid_rects
)
{
struct
window_surface
*
surface
;
RECT
dst
=
valid_rects
[
0
];
RECT
src
=
valid_rects
[
1
];
WND
*
win
;
if
(
src
.
left
==
dst
.
left
&&
src
.
top
==
dst
.
top
)
return
;
if
(
!
(
win
=
WIN_GetPtr
(
parent
)))
return
;
if
(
win
==
WND_DESKTOP
||
win
==
WND_OTHER_PROCESS
)
return
;
if
(
!
(
surface
=
win
->
surface
))
{
WIN_ReleasePtr
(
win
);
return
;
}
TRACE
(
"copying %s -> %s
\n
"
,
wine_dbgstr_rect
(
&
src
),
wine_dbgstr_rect
(
&
dst
));
MapWindowPoints
(
GetAncestor
(
hwnd
,
GA_PARENT
),
parent
,
(
POINT
*
)
&
src
,
2
);
OffsetRect
(
&
src
,
win
->
rectClient
.
left
-
win
->
visible_rect
.
left
,
win
->
rectClient
.
top
-
win
->
visible_rect
.
top
);
OffsetRect
(
&
dst
,
-
window_rect
->
left
,
-
window_rect
->
top
);
window_surface_add_ref
(
surface
);
WIN_ReleasePtr
(
win
);
copy_bits_from_surface
(
hwnd
,
surface
,
&
dst
,
&
src
);
window_surface_release
(
surface
);
}
/***********************************************************************
* update_now
*
* Implementation of RDW_UPDATENOW behavior.
...
...
dlls/user32/user_private.h
View file @
5b9c69b9
...
...
@@ -232,6 +232,8 @@ extern void move_window_bits( HWND hwnd, struct window_surface *old_surface,
struct
window_surface
*
new_surface
,
const
RECT
*
visible_rect
,
const
RECT
*
old_visible_rect
,
const
RECT
*
window_rect
,
const
RECT
*
valid_rects
)
DECLSPEC_HIDDEN
;
extern
void
move_window_bits_parent
(
HWND
hwnd
,
HWND
parent
,
const
RECT
*
window_rect
,
const
RECT
*
valid_rects
)
DECLSPEC_HIDDEN
;
extern
void
*
get_hook_proc
(
void
*
proc
,
const
WCHAR
*
module
,
HMODULE
*
free_module
)
DECLSPEC_HIDDEN
;
extern
RECT
get_virtual_screen_rect
(
void
)
DECLSPEC_HIDDEN
;
extern
LRESULT
call_current_hook
(
HHOOK
hhook
,
INT
code
,
WPARAM
wparam
,
LPARAM
lparam
)
DECLSPEC_HIDDEN
;
...
...
dlls/user32/winpos.c
View file @
5b9c69b9
...
...
@@ -2060,8 +2060,7 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
WND
*
win
;
HWND
surface_win
=
0
,
parent
=
GetAncestor
(
hwnd
,
GA_PARENT
);
BOOL
ret
,
needs_update
=
FALSE
;
int
old_width
;
RECT
visible_rect
,
old_visible_rect
,
old_window_rect
;
RECT
visible_rect
,
old_visible_rect
,
old_window_rect
,
old_client_rect
;
struct
window_surface
*
old_surface
,
*
new_surface
=
NULL
;
if
(
!
parent
||
parent
==
GetDesktopWindow
())
...
...
@@ -2080,8 +2079,8 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
if
(
new_surface
)
window_surface_release
(
new_surface
);
return
FALSE
;
}
old_width
=
win
->
rectClient
.
right
-
win
->
rectClient
.
left
;
old_visible_rect
=
win
->
visible_rect
;
old_client_rect
=
win
->
rectClient
;
old_surface
=
win
->
surface
;
if
(
old_surface
!=
new_surface
)
swp_flags
|=
SWP_FRAMECHANGED
;
/* force refreshing non-client area */
...
...
@@ -2126,7 +2125,8 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
mirror_rect
(
&
client
,
&
win
->
visible_rect
);
}
/* if an RTL window is resized the children have moved */
if
(
win
->
dwExStyle
&
WS_EX_LAYOUTRTL
&&
client_rect
->
right
-
client_rect
->
left
!=
old_width
)
if
(
win
->
dwExStyle
&
WS_EX_LAYOUTRTL
&&
client_rect
->
right
-
client_rect
->
left
!=
old_client_rect
.
right
-
old_client_rect
.
left
)
win
->
flags
|=
WIN_CHILDREN_MOVED
;
}
}
...
...
@@ -2156,6 +2156,33 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
}
window_surface_release
(
old_surface
);
}
else
if
(
surface_win
&&
surface_win
!=
hwnd
)
{
if
(
!
IsRectEmpty
(
valid_rects
))
{
RECT
rects
[
2
];
int
x_offset
=
old_visible_rect
.
left
-
visible_rect
.
left
;
int
y_offset
=
old_visible_rect
.
top
-
visible_rect
.
top
;
/* if all that happened is that the whole window moved, copy everything */
if
(
!
(
swp_flags
&
SWP_FRAMECHANGED
)
&&
old_visible_rect
.
right
-
visible_rect
.
right
==
x_offset
&&
old_visible_rect
.
bottom
-
visible_rect
.
bottom
==
y_offset
&&
old_client_rect
.
left
-
client_rect
->
left
==
x_offset
&&
old_client_rect
.
right
-
client_rect
->
right
==
x_offset
&&
old_client_rect
.
top
-
client_rect
->
top
==
y_offset
&&
old_client_rect
.
bottom
-
client_rect
->
bottom
==
y_offset
&&
EqualRect
(
&
valid_rects
[
0
],
client_rect
))
{
rects
[
0
]
=
visible_rect
;
rects
[
1
]
=
old_visible_rect
;
valid_rects
=
rects
;
}
move_window_bits_parent
(
hwnd
,
surface_win
,
window_rect
,
valid_rects
);
valid_rects
=
NULL
;
/* prevent the driver from trying to also move the bits */
}
}
USER_Driver
->
pWindowPosChanged
(
hwnd
,
insert_after
,
swp_flags
,
window_rect
,
client_rect
,
&
visible_rect
,
valid_rects
,
new_surface
);
}
...
...
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