On ConfigureNotify, find the first visible window above the current one.
diff --git a/windows/x11drv/event.c b/windows/x11drv/event.c index 867831d..cdc6f2f 100644 --- a/windows/x11drv/event.c +++ b/windows/x11drv/event.c
@@ -821,12 +821,24 @@ /* Get geometry and Z-order according to Wine */ - GetWindowRect( hWnd, &rectWindow ); - oldInsertAfter = GetWindow( hWnd, GW_HWNDPREV ); - if ( !oldInsertAfter ) oldInsertAfter = HWND_TOP; + /* + * Needs to find the first Visible Window above the current one + */ + oldInsertAfter = hWnd; + for (;;) + { + oldInsertAfter = GetWindow( oldInsertAfter, GW_HWNDPREV ); + if (!oldInsertAfter) + { + oldInsertAfter = HWND_TOP; + break; + } + if (GetWindowLongA( oldInsertAfter, GWL_STYLE ) & WS_VISIBLE) break; + } /* Compare what has changed */ + GetWindowRect( hWnd, &rectWindow ); if ( rectWindow.left == x && rectWindow.top == y ) flags |= SWP_NOMOVE; else