[PATCH 0/2] MR9590: winex11: Pass client rect to create_client_window.
Split from https://gitlab.winehq.org/wine/wine/-/merge_requests/9584, that other MR isn't right with child client surface positioning. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9590
From: Rémi Bernon <rbernon(a)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 f6fe0aed894..5ac239e68e5 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -449,8 +449,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 ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9590
From: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/winex11.drv/opengl.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 93eef753b78..e945b14b3b1 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -529,11 +529,8 @@ static BOOL x11drv_egl_surface_create( HWND hwnd, int format, struct opengl_draw struct client_surface *client; struct gl_drawable *gl; Window window; - RECT rect; if ((previous = *drawable) && previous->format == format) return TRUE; - NtUserGetClientRect( hwnd, &rect, NtUserGetDpiForWindow( hwnd ) ); - if (!(window = x11drv_client_surface_create( hwnd, format, &client ))) return FALSE; gl = opengl_drawable_create( sizeof(*gl), &x11drv_egl_surface_funcs, format, client ); client_surface_release( client ); @@ -969,11 +966,8 @@ static BOOL x11drv_surface_create( HWND hwnd, int format, struct opengl_drawable struct client_surface *client; struct gl_drawable *gl; Window window; - RECT rect; if ((previous = *drawable) && previous->format == format) return TRUE; - NtUserGetClientRect( hwnd, &rect, NtUserGetDpiForWindow( hwnd ) ); - if (!(window = x11drv_client_surface_create( hwnd, format, &client ))) return FALSE; gl = opengl_drawable_create( sizeof(*gl), &x11drv_surface_funcs, format, client ); client_surface_release( client ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9590
participants (1)
-
Rémi Bernon