From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/init.c | 2 +- dlls/winex11.drv/window.c | 8 ++------ dlls/winex11.drv/x11drv.h | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 1ea51e9a387..f468898cacb 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -448,8 +448,8 @@ Window x11drv_client_surface_create( HWND hwnd, int format, struct client_surfac if (!(surface = client_surface_create( sizeof(*surface), &x11drv_client_surface_funcs, hwnd ))) goto failed; surface->colormap = colormap;
- if (!(surface->window = create_client_window( hwnd, &visual, colormap ))) goto failed; if (!NtUserGetClientRect( hwnd, &surface->rect, NtUserGetDpiForWindow( hwnd ) )) goto failed; + if (!(surface->window = create_client_window( hwnd, surface->rect, &visual, colormap ))) goto failed;
TRACE( "Created %s for client window %lx\n", debugstr_client_surface( &surface->client ), surface->window ); *client = &surface->client; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 21a6a58ba4b..650dcf12cfa 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2362,13 +2362,12 @@ void destroy_client_window( HWND hwnd, Window client_window ) /********************************************************************** * create_client_window */ -Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap ) +Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *visual, Colormap colormap ) { struct x11drv_win_data *data = get_win_data( hwnd ); XSetWindowAttributes attr; Window ret; int x, y, cx, cy; - RECT client_rect;
if (!data) { @@ -2376,8 +2375,7 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colo HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); if (parent == NtUserGetDesktopWindow() || NtUserGetAncestor( parent, GA_PARENT )) return 0; if (!(data = alloc_win_data( thread_init_display(), hwnd ))) return 0; - NtUserGetClientRect( hwnd, &data->rects.client, NtUserGetWinMonitorDpi( hwnd, MDT_RAW_DPI ) ); - data->rects.window = data->rects.visible = data->rects.client; + data->rects.window = data->rects.visible = data->rects.client = client_rect; }
detach_client_window( data, data->client_window ); @@ -2390,8 +2388,6 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colo
x = data->rects.client.left - data->rects.visible.left; y = data->rects.client.top - data->rects.visible.top; - - NtUserGetClientRect( hwnd, &client_rect, NtUserGetDpiForWindow( hwnd ) ); cx = min( max( 1, client_rect.right - client_rect.left ), 65535 ); cy = min( max( 1, client_rect.bottom - client_rect.top ), 65535 );
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index e08a7a85652..9232988c9c7 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -723,7 +723,7 @@ extern Window init_clip_window(void); extern void window_set_user_time( struct x11drv_win_data *data, Time time, BOOL init ); extern UINT get_window_net_wm_state( Display *display, Window window ); extern void make_window_embedded( struct x11drv_win_data *data ); -extern Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap ); +extern Window create_client_window( HWND hwnd, RECT client_rect, const XVisualInfo *visual, Colormap colormap ); extern void detach_client_window( struct x11drv_win_data *data, Window client_window ); extern void attach_client_window( struct x11drv_win_data *data, Window client_window ); extern void destroy_client_window( HWND hwnd, Window client_window );