NtUserCreateWindowEx will call apply_window_pos and drivers WindowPosChanging callback, which already creates window data.
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/window.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 68b34fa868d..e71b0150223 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2176,7 +2176,6 @@ static struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd, const RECT *wi */ HWND create_foreign_window( Display *display, Window xwin ) { - static const WCHAR classW[] = {'_','_','w','i','n','e','_','x','1','1','_','f','o','r','e','i','g','n','_','w','i','n','d','o','w',0}; static BOOL class_registered; struct x11drv_win_data *data; HWND hwnd, parent; @@ -2186,7 +2185,7 @@ HWND create_foreign_window( Display *display, Window xwin ) unsigned int nchildren; XWindowAttributes attr; UINT style = WS_CLIPCHILDREN; - UNICODE_STRING class_name = RTL_CONSTANT_STRING( classW ); + UNICODE_STRING class_name = RTL_CONSTANT_STRING( foreign_window_prop );
if (!class_registered) { @@ -2196,7 +2195,7 @@ HWND create_foreign_window( Display *display, Window xwin ) memset( &class, 0, sizeof(class) ); class.cbSize = sizeof(class); class.lpfnWndProc = client_foreign_window_proc; - class.lpszClassName = classW; + class.lpszClassName = foreign_window_prop; if (!NtUserRegisterClassExWOW( &class, &class_name, &version, NULL, 0, 0, NULL ) && RtlGetLastWin32Error() != ERROR_CLASS_ALREADY_EXISTS) { @@ -2232,7 +2231,6 @@ HWND create_foreign_window( Display *display, Window xwin ) pos.y = attr.y; }
- RtlInitUnicodeString( &class_name, classW ); 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 );
From: Rémi Bernon rbernon@codeweavers.com
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 e71b0150223..726ed354a64 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2234,15 +2234,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;