Ask for an MDI child id in all cases
Dmitry Timoshkov
dmitry at baikal.ru
Tue Mar 1 09:13:32 CST 2005
Hello,
this is a fix for my fault: if the coordinates of a window are not set
to default MDI child id was not set.
Changelog:
Dmitry Timoshkov <dmitry at codeweavers.com>
Ask for an MDI child id in all cases.
diff -up cvs/hq/wine/windows/mdi.c wine/windows/mdi.c
--- cvs/hq/wine/windows/mdi.c 2005-02-17 15:32:40.000000000 +0800
+++ wine/windows/mdi.c 2005-03-01 22:50:23.000000000 +0800
@@ -258,6 +258,7 @@ void MDI_CalcDefaultChildPos( HWND hwndC
MDICLIENTINFO *ci = get_client_info(hwndClient);
total = ci ? ci->nTotalCreated : 0;
*id = ci->idFirstChild + ci->nActiveChildren;
+ TRACE("MDI child id %04x\n", *id);
}
GetClientRect( hwndClient, &rect );
@@ -1039,7 +1040,7 @@ static LRESULT MDIClientWndProc_common(
if (!hBmpClose) hBmpClose = CreateMDIMenuBitmap();
- TRACE("Client created: hwnd %p, Window menu %p, idFirst = %u\n",
+ TRACE("Client created: hwnd %p, Window menu %p, idFirst = %04x\n",
hwnd, ci->hWindowMenu, ci->idFirstChild );
return 0;
}
diff -up cvs/hq/wine/windows/win.c wine/windows/win.c
--- cvs/hq/wine/windows/win.c 2005-02-26 17:42:57.000000000 +0800
+++ wine/windows/win.c 2005-03-01 22:58:56.000000000 +0800
@@ -800,6 +800,18 @@ BOOL WIN_CreateDesktopWindow(void)
*/
static void WIN_FixCoordinates( CREATESTRUCTA *cs, INT *sw)
{
+ POINT pos[2];
+
+ if (cs->dwExStyle & WS_EX_MDICHILD)
+ {
+ UINT id = 0;
+
+ MDI_CalcDefaultChildPos(cs->hwndParent, -1, pos, 0, &id);
+ if (!(cs->style & WS_POPUP)) cs->hMenu = (HMENU)id;
+
+ TRACE("MDI child id %04x\n", id);
+ }
+
if (cs->x == CW_USEDEFAULT || cs->x == CW_USEDEFAULT16 ||
cs->cx == CW_USEDEFAULT || cs->cx == CW_USEDEFAULT16)
{
@@ -807,12 +819,6 @@ static void WIN_FixCoordinates( CREATEST
{
if (cs->dwExStyle & WS_EX_MDICHILD)
{
- UINT id = 0;
- POINT pos[2];
-
- MDI_CalcDefaultChildPos(cs->hwndParent, -1, pos, 0, &id);
- if (!(cs->style & WS_POPUP)) cs->hMenu = (HMENU)id;
-
if (cs->x == CW_USEDEFAULT || cs->x == CW_USEDEFAULT16)
{
cs->x = pos[0].x;
@@ -1931,6 +1937,8 @@ static LONG_PTR WIN_GetWindowLong( HWND
LONG_PTR retvalue = 0;
WND *wndPtr;
+ TRACE( "%p %d %x\n", hwnd, offset, type );
+
if (offset == GWLP_HWNDPARENT)
{
HWND parent = GetAncestor( hwnd, GA_PARENT );
More information about the wine-patches
mailing list