dlls/x11drv/winpos.c::SWP_DoOwnedPopups

Peter Riocreux par+wine_devel at silistix.com
Tue Oct 19 10:46:09 CDT 2004


Peter Riocreux <par+wine_devel at silistix.com> writes:

> I have a lot of WARNs from this function so I thought I would have a
> shufty at it  to see if it was easy to fix.
>
> The FIXME above it is written so as to suggest that it is a matter of
> mere keystrokes to fix it up, or weeks of work, depending on your
> frame of mind when you read it.
>
> Still being a beginner (first patch now committed be Aj - yay!) and
> not knowing about Windows programming, I don't know where to look to
> decide which is the case.
>
> The comment above it says:
>
>
> /***********************************************************************
>  *           SWP_DoOwnedPopups
>  *
>  * fix Z order taking into account owned popups -
>  * basically we need to maintain them above the window that owns them
>  *
>  * FIXME: hide/show owned popups when owner visibility changes.
>  */
>
> It looks like, depending on some property of 'owner' it should or
> shouldn't use the property SWP_HIDEWINDOW in the call to SetWindowPos
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/setwindowpos.asp>
>
> If this is the case I could fix it, if I knew how to determine when
> 'owner' is visible.
>
> Do I also need a callback of some kind so that the popup is rendered
> invisible when the parent is, even if SWP_DoOwnedPopups is not called
> (or is that not (supposed to be) possible?)?
>
> Is the WARN there only because of the FIXME and if I fix the FIXME I
> should remove the WARN?


To follow myself up - I am an a**e. I have now found the function
IsWindowVisible so is the following patch sensible? The question of
removing the WARN still remains though.


Index: dlls/x11drv/winpos.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/winpos.c,v
retrieving revision 1.103
diff -u -r1.103 winpos.c
--- dlls/x11drv/winpos.c        17 Sep 2004 18:20:11 -0000      1.103
+++ dlls/x11drv/winpos.c        19 Oct 2004 15:41:59 -0000
@@ -655,9 +655,14 @@
             if ((GetWindowLongW( list[i], GWL_STYLE ) & WS_POPUP) &&
                 GetWindow( list[i], GW_OWNER ) == hwnd)
             {
+             if (IsWindowVisible(owner))
                 SetWindowPos( list[i], hwndInsertAfter, 0, 0, 0, 0,
                               SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE |
                               SWP_NOSENDCHANGING | SWP_DEFERERASE );
+             else
+                SetWindowPos( list[i], hwndInsertAfter, 0, 0, 0, 0,
+                              SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE |
+                              SWP_NOSENDCHANGING | SWP_DEFERERASE | SWP_HIDEWINDOW);
                 hwndInsertAfter = list[i];
             }
         }



More information about the wine-devel mailing list