Commit 08eac70d authored by Alexandre Julliard's avatar Alexandre Julliard

Avoid the 'Below' stacking mode when changing Z order since many

window managers don't get it right. Fix Z order synchronization for child windows (found by Dmitry Timoshkov and Ulrich Czekalla).
parent 42c4d278
...@@ -526,6 +526,8 @@ int X11DRV_sync_whole_window_position( Display *display, WND *win, int zorder ) ...@@ -526,6 +526,8 @@ int X11DRV_sync_whole_window_position( Display *display, WND *win, int zorder )
if (zorder) if (zorder)
{ {
if (is_window_top_level( win ))
{
/* find window that this one must be after */ /* find window that this one must be after */
HWND prev = GetWindow( win->hwndSelf, GW_HWNDPREV ); HWND prev = GetWindow( win->hwndSelf, GW_HWNDPREV );
while (prev && !(GetWindowLongW( prev, GWL_STYLE ) & WS_VISIBLE)) while (prev && !(GetWindowLongW( prev, GWL_STYLE ) & WS_VISIBLE))
...@@ -537,11 +539,35 @@ int X11DRV_sync_whole_window_position( Display *display, WND *win, int zorder ) ...@@ -537,11 +539,35 @@ int X11DRV_sync_whole_window_position( Display *display, WND *win, int zorder )
} }
else else
{ {
/* should use stack_mode Below but most window managers don't get it right */
/* so move it above the next one in Z order */
HWND next = GetWindow( win->hwndSelf, GW_HWNDNEXT );
while (next && !(GetWindowLongW( next, GWL_STYLE ) & WS_VISIBLE))
next = GetWindow( next, GW_HWNDNEXT );
if (next)
{
changes.stack_mode = Above;
changes.sibling = X11DRV_get_whole_window(next);
mask |= CWStackMode | CWSibling;
}
}
}
else
{
HWND next = GetWindow( win->hwndSelf, GW_HWNDNEXT );
if (!next) /* bottom child */
{
changes.stack_mode = Below; changes.stack_mode = Below;
changes.sibling = X11DRV_get_whole_window(prev); mask |= CWStackMode;
}
else
{
changes.stack_mode = Above;
changes.sibling = X11DRV_get_whole_window(next);
mask |= CWStackMode | CWSibling; mask |= CWStackMode | CWSibling;
} }
} }
}
data->whole_rect = whole_rect; data->whole_rect = whole_rect;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment