Module: wine Branch: master Commit: e2845104d15db4ce7c67d9848346877a89dbd790 URL: https://gitlab.winehq.org/wine/wine/-/commit/e2845104d15db4ce7c67d9848346877...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri May 3 14:19:47 2024 +0200
winex11: Avoid leaking foreign window data if it was already created.
NtUserCreateWindowEx will call apply_window_pos and drivers WindowPosChanging callback, which already creates window data.
---
dlls/winex11.drv/window.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index f8202750695..c6bf49c6ec8 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2229,15 +2229,12 @@ HWND create_foreign_window( Display *display, Window xwin ) hwnd = NtUserCreateWindowEx( 0, &class_name, &class_name, NULL, style, pos.x, pos.y, attr.width, attr.height, parent, 0, NULL, NULL, 0, NULL, 0, FALSE ); - - if (!(data = alloc_win_data( display, hwnd ))) + if (!(data = get_win_data( hwnd ))) { NtUserDestroyWindow( hwnd ); return 0; } - SetRect( &data->window_rect, pos.x, pos.y, pos.x + attr.width, pos.y + attr.height ); - data->whole_rect = data->client_rect = data->window_rect; - data->whole_window = data->client_window = 0; + destroy_whole_window( data, FALSE ); data->embedded = TRUE; data->mapped = TRUE;