[PATCH 13/14] user32: Send the size messages from user32's
CreateWindow
Pierre d'Herbemont
pdherbemont at free.fr
Sun Jan 21 17:37:22 CST 2007
---
dlls/user32/win.c | 17 +++++++++++++++++
dlls/winex11.drv/window.c | 17 -----------------
2 files changed, 17 insertions(+), 17 deletions(-)
-------------- next part --------------
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index 37e93a2..698a6a4 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -1184,6 +1184,23 @@ static HWND WIN_CreateWindowEx( CREATEST
NotifyWinEvent(EVENT_OBJECT_CREATE, hwnd, OBJID_WINDOW, 0);
+ /* Send the size messages */
+
+ if (!(wndPtr = WIN_GetPtr(hwnd)) || wndPtr == WND_OTHER_PROCESS) return FALSE;
+ if (!(wndPtr->flags & WIN_NEED_SIZE))
+ {
+ RECT rect = wndPtr->rectClient;
+ WIN_ReleasePtr( wndPtr );
+ /* send it anyway */
+ if (((rect.right-rect.left) <0) ||((rect.bottom-rect.top)<0))
+ WARN("sending bogus WM_SIZE message 0x%08x\n",
+ MAKELONG(rect.right-rect.left, rect.bottom-rect.top));
+ SendMessageW( hwnd, WM_SIZE, SIZE_RESTORED,
+ MAKELONG(rect.right-rect.left, rect.bottom-rect.top));
+ SendMessageW( hwnd, WM_MOVE, 0, MAKELONG( rect.left, rect.top ) );
+ }
+ else WIN_ReleasePtr( wndPtr );
+
if (!(wndPtr = WIN_GetPtr(hwnd))) goto failed;
client_rect = wndPtr->rectClient;
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 3abdf53..7894856 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1037,23 +1037,6 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CRE
data->client_rect.right, data->client_rect.bottom,
(unsigned int)data->whole_window );
- /* Send the size messages */
-
- if (!(wndPtr = WIN_GetPtr(hwnd)) || wndPtr == WND_OTHER_PROCESS) return FALSE;
- if (!(wndPtr->flags & WIN_NEED_SIZE))
- {
- RECT rect = wndPtr->rectClient;
- WIN_ReleasePtr( wndPtr );
- /* send it anyway */
- if (((rect.right-rect.left) <0) ||((rect.bottom-rect.top)<0))
- WARN("sending bogus WM_SIZE message 0x%08x\n",
- MAKELONG(rect.right-rect.left, rect.bottom-rect.top));
- SendMessageW( hwnd, WM_SIZE, SIZE_RESTORED,
- MAKELONG(rect.right-rect.left, rect.bottom-rect.top));
- SendMessageW( hwnd, WM_MOVE, 0, MAKELONG( rect.left, rect.top ) );
- }
- else WIN_ReleasePtr( wndPtr );
-
/* Make sure we've updated the window title if SetWindowText was called
before alloc_win_data */
if (!(wndPtr = WIN_GetPtr(hwnd)) || wndPtr == WND_OTHER_PROCESS) return FALSE;
More information about the wine-patches
mailing list