From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/event.c | 3 ++- dlls/winex11.drv/window.c | 53 ++------------------------------------- dlls/winex11.drv/x11drv.h | 1 - 3 files changed, 4 insertions(+), 53 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index ca9ab4b8aed..e7cc3855c2d 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1073,7 +1073,8 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) } else pos = root_to_virtual_screen( x, y );
- X11DRV_X_to_window_rect( data, &rect, pos.x, pos.y, event->width, event->height ); + 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", diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 6b0329418cf..82c6a372530 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1319,56 +1319,6 @@ void make_window_embedded( struct x11drv_win_data *data ) }
-/*********************************************************************** - * get_decoration_rect - */ -static void get_decoration_rect( struct x11drv_win_data *data, RECT *rect, - const RECT *window_rect, const RECT *client_rect ) -{ - DWORD style, ex_style, style_mask = 0, ex_style_mask = 0; - unsigned long decor; - UINT dpi; - - SetRectEmpty( rect ); - if (!data->managed) return; - - dpi = get_win_monitor_dpi( data->hwnd ); - style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); - ex_style = NtUserGetWindowLongW( data->hwnd, GWL_EXSTYLE ); - decor = get_mwm_decorations( data, style, ex_style, window_rect, client_rect ); - - if (decor & MWM_DECOR_TITLE) style_mask |= WS_CAPTION; - if (decor & MWM_DECOR_BORDER) - { - style_mask |= WS_DLGFRAME | WS_THICKFRAME; - ex_style_mask |= WS_EX_DLGMODALFRAME; - } - - NtUserAdjustWindowRect( rect, style & style_mask, FALSE, ex_style & ex_style_mask, dpi ); -} - - -/*********************************************************************** - * X11DRV_X_to_window_rect - * - * Opposite of X11DRV_window_to_X_rect - */ -void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect, int x, int y, int cx, int cy ) -{ - RECT rc; - - get_decoration_rect( data, &rc, &data->rects.window, &data->rects.client ); - - x += min( data->rects.window.left - data->rects.visible.left, rc.left ); - y += min( data->rects.window.top - data->rects.visible.top, rc.top ); - cx += max( (data->rects.window.right - data->rects.window.left) - - (data->rects.visible.right - data->rects.visible.left), rc.right - rc.left ); - cy += max( (data->rects.window.bottom - data->rects.window.top) - - (data->rects.visible.bottom - data->rects.visible.top), rc.bottom - rc.top ); - SetRect( rect, x, y, x + cx, y + cy ); -} - - /*********************************************************************** * sync_window_position * @@ -2810,7 +2760,8 @@ UINT X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) &root, &x, &y, &width, &height, &border, &depth ); XTranslateCoordinates( thread_data->display, data->whole_window, root, 0, 0, &x, &y, &top ); pos = root_to_virtual_screen( x, y ); - X11DRV_X_to_window_rect( data, rect, pos.x, pos.y, width, height ); + SetRect( rect, pos.x, pos.y, pos.x + width, pos.y + height ); + *rect = window_rect_from_visible( &data->rects, *rect ); swp &= ~(SWP_NOMOVE | SWP_NOCLIENTMOVE | SWP_NOSIZE | SWP_NOCLIENTSIZE);
done: diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 947eb1a10e3..b87d6a87932 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -678,7 +678,6 @@ typedef int (*x11drv_error_callback)( Display *display, XErrorEvent *event, void
extern void X11DRV_expect_error( Display *display, x11drv_error_callback callback, void *arg ); extern int X11DRV_check_error(void); -extern void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect, int x, int y, int cx, int cy ); extern POINT virtual_screen_to_root( INT x, INT y ); extern POINT root_to_virtual_screen( INT x, INT y ); extern RECT get_host_primary_monitor_rect(void);