From: Jinoh Kang jinoh.kang.kr@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53153 Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com --- dlls/user32/tests/msg.c | 8 ++++---- server/window.c | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 9b4680bbcc1..fb22f6042fe 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -9302,8 +9302,8 @@ static void subtest_swp_paint_regions_( int line, int wrap_toplevel, LPCSTR pare } else { - todo_wine_if( EqualRect( &rect_old, &rect_new ) ? is_zorder_redraw : - ((extest->style & WS_CLIPCHILDREN) == 0 && !is_composited) ) + todo_wine_if( !EqualRect( &rect_old, &rect_new ) && + (extest->style & WS_CLIPCHILDREN) == 0 && !is_composited ) ok( !!rgn_ok, "Parent update region shall match expected region\n" ); }
@@ -9365,8 +9365,8 @@ static void subtest_swp_paint_regions_( int line, int wrap_toplevel, LPCSTR pare } else { - todo_wine_if( EqualRect( &rect_old, &rect_new ) ? is_zorder_redraw : - ((extest->style & WS_CLIPCHILDREN) == 0 && !is_composited) ) + todo_wine_if( !EqualRect( &rect_old, &rect_new ) && + (extest->style & WS_CLIPCHILDREN) == 0 && !is_composited ) ok( !!rgn_ok, "Child update region shall match expected region\n" ); }
diff --git a/server/window.c b/server/window.c index e3f21f2b76d..714fffdc8a1 100644 --- a/server/window.c +++ b/server/window.c @@ -1719,14 +1719,14 @@ static unsigned int get_window_update_flags( struct window *win, struct window * /* expose the areas revealed by a vis region change on the window parent */ /* returns the region exposed on the window itself (in client coordinates) */ static struct region *expose_window( struct window *win, const rectangle_t *old_window_rect, - struct region *old_vis_rgn ) + struct region *old_vis_rgn, int zorder_changed ) { struct region *new_vis_rgn, *exposed_rgn; int is_composited = win->parent && is_window_composited( win->parent );
if (!(new_vis_rgn = get_visible_region( win, DCX_WINDOW ))) return NULL;
- if (is_composited && + if (is_composited && !zorder_changed && is_rect_equal( old_window_rect, &win->window_rect ) && is_region_equal( old_vis_rgn, new_vis_rgn )) { @@ -1787,6 +1787,7 @@ static void set_window_pos( struct window *win, struct window *previous, rectangle_t rect; int client_changed, frame_changed; int visible = (win->style & WS_VISIBLE) || (swp_flags & SWP_SHOWWINDOW); + int zorder_changed = 0;
if (win->parent && !is_visible( win->parent )) visible = 0;
@@ -1798,7 +1799,12 @@ static void set_window_pos( struct window *win, struct window *previous, win->visible_rect = *visible_rect; win->surface_rect = *surface_rect; win->client_rect = *client_rect; - if (!(swp_flags & SWP_NOZORDER) && win->parent) link_window( win, previous ); + if (!(swp_flags & SWP_NOZORDER) && win->parent) + { + struct list *old_prev = win->is_linked ? win->entry.prev : NULL; + link_window( win, previous ); + if (old_prev != win->entry.prev) zorder_changed = 1; + } if (swp_flags & SWP_SHOWWINDOW) win->style |= WS_VISIBLE; else if (swp_flags & SWP_HIDEWINDOW) win->style &= ~WS_VISIBLE;
@@ -1827,7 +1833,7 @@ static void set_window_pos( struct window *win, struct window *previous, /* expose anything revealed by the change */
if (!(swp_flags & SWP_NOREDRAW)) - exposed_rgn = expose_window( win, &old_window_rect, old_vis_rgn ); + exposed_rgn = expose_window( win, &old_window_rect, old_vis_rgn, zorder_changed );
if (!(win->style & WS_VISIBLE)) { @@ -1958,7 +1964,7 @@ static void set_window_region( struct window *win, struct region *region, int re win->win_region = region;
/* expose anything revealed by the change */ - if (old_vis_rgn && ((exposed_rgn = expose_window( win, &win->window_rect, old_vis_rgn )))) + if (old_vis_rgn && ((exposed_rgn = expose_window( win, &win->window_rect, old_vis_rgn, 0 )))) { redraw_window( win, exposed_rgn, 1, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN ); free_region( exposed_rgn ); @@ -1983,7 +1989,7 @@ void free_window_handle( struct window *win ) win->style &= ~WS_VISIBLE; if (vis_rgn) { - struct region *exposed_rgn = expose_window( win, &win->window_rect, vis_rgn ); + struct region *exposed_rgn = expose_window( win, &win->window_rect, vis_rgn, 0 ); if (exposed_rgn) free_region( exposed_rgn ); free_region( vis_rgn ); }