From: Rémi Bernon rbernon@codeweavers.com
These windows might have a (foreign) window parent, and we need to move them relatively to their parent. This uses XTranslateCoordinates to get relative positioning instead of NtUserMapWindowPoints. --- dlls/winex11.drv/event.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 9271758090e..38f0c05d3ac 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1029,11 +1029,10 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) { XConfigureEvent *event = &xev->xconfigure; struct x11drv_win_data *data; + Window child; RECT rect; POINT pos; UINT flags, dpi; - HWND parent; - BOOL root_coords; int cx, cy, x = event->x, y = event->y; DWORD style;
@@ -1051,30 +1050,29 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) goto done; }
- /* Get geometry */ - - dpi = get_win_monitor_dpi( data->hwnd ); - parent = NtUserGetAncestor( hwnd, GA_PARENT ); - root_coords = event->send_event; /* synthetic events are always in root coords */ - - if (!root_coords && parent == NtUserGetDesktopWindow()) /* normal event, map coordinates to the root */ + if (data->embedded || !data->whole_window) { - Window child; - XTranslateCoordinates( event->display, event->window, root_window, - 0, 0, &x, &y, &child ); - root_coords = TRUE; - } + Window parent = data->embedder ? data->embedder : root_window; + flags = SWP_NOACTIVATE | SWP_NOZORDER; + if (!data->whole_window) flags |= SWP_NOCOPYBITS; /* we can't copy bits of foreign windows */ + release_win_data( data );
- if (!root_coords) - { - pos.x = x; - pos.y = y; + XTranslateCoordinates( event->display, event->window, parent, 0, 0, (int *)&pos.x, (int *)&pos.y, &child ); + if (parent == root_window) pos = root_to_virtual_screen( pos.x, pos.y ); + set_window_pos( hwnd, 0, pos.x, pos.y, event->width, event->height, flags ); + return TRUE; } - else pos = root_to_virtual_screen( x, y ); + + /* Get geometry */ + + dpi = get_win_monitor_dpi( data->hwnd ); + /* synthetic events are always in root coords */ + if (!event->send_event) XTranslateCoordinates( event->display, event->window, root_window, + 0, 0, &x, &y, &child ); + pos = root_to_virtual_screen( x, y );
SetRect( &rect, pos.x, pos.y, pos.x + event->width, pos.y + event->height ); rect = window_rect_from_visible( &data->rects, rect ); - if (root_coords) NtUserMapWindowPoints( 0, parent, (POINT *)&rect, 2, 0 /* per-monitor DPI */ );
TRACE( "win %p/%lx new X rect %d,%d,%dx%d (event %d,%d,%dx%d)\n", hwnd, data->whole_window, (int)rect.left, (int)rect.top,