user32: Restore old WM_SIZE handler in mdi child

Dmitry Timoshkov dmitry at codeweavers.com
Sun Jan 21 22:33:29 CST 2007


"Peter Oberndorfer" <kumbayo84 at arcor.de> wrote:

> this patch seems to cause http://bugs.winehq.org/show_bug.cgi?id=7190
> Each time a MDI child window gets a WM_SIZE the left most menu entry disapperars.
> The problem is that MDI_RestoreFrameMenu is called for each WM_SIZE message,
> that does not maximize the window, instead of only beeing called when window goes from maximized to normal
> And MDI_RestoreFrameMenu removes the left most menu entry,
> in belief is the document icon of a maximized child.
> 
> What is the reason for restoring the old code?
> Does the new code break some apps?

Old code seemed to be more correct because it makes more MDI message tests pass.

> The attached patch, which reverts a part of the revert "fixes" the problem for my test app(ollydbg)
> But i guess it is totally wrong :-)
>> 
>> this patch restores (almost completely) an old WM_SIZE handler in mdi child,
>> including the comment /* do not change */.
>> 
>> Changelog:
>>     user32: Restore old WM_SIZE handler in mdi child.
>> 
> 
> Greetings Peter
> 
> diff --git a/dlls/user32/mdi.c b/dlls/user32/mdi.c
> index f8bb8f8..dace1e8 100644
> --- a/dlls/user32/mdi.c
> +++ b/dlls/user32/mdi.c
> @@ -1518,7 +1518,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
>         /* do not change */
>         TRACE("current active %p, maximized %p\n", ci->hwndActiveChild, ci->hwndChildMaximized);
> 
> -        if( ci->hwndActiveChild == hwnd && wParam != SIZE_MAXIMIZED )
> +        if( ci->hwndChildMaximized == hwnd && wParam != SIZE_MAXIMIZED )
>         {
>             HWND frame;
> 

Good catch! The fix looks reasonable. Please submit to wine-patches.
Thanks for finding the source of the regression.

-- 
Dmitry.



More information about the wine-devel mailing list