dlls/x11drv/winpos.c::SWP_DoOwnedPopups()

Peter Riocreux par+wine_patches at silistix.com
Wed Oct 20 04:33:57 CDT 2004


I mentioned this on wine-devel but got no response so I will run it
past here.

The comment above SWP_DoOwnedPopups in dlls/x11drv/winpos.c suggests
that the only thing missing is what I *might* have fixed here,
therefore the patch also removes the FIXME and the WARN. It compiles
and doesn't break any behaviour I can test, but I am only guessing
whether I have done the right thing.



Changelog:
    Peter Riocreux <par+wine_patches at silistix.com>
    Fix popup visibility when owner's visibility changes


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        20 Oct 2004 09:24:22 -0000
@@ -612,7 +612,6 @@
  * 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.
  */
 static HWND SWP_DoOwnedPopups(HWND hwnd, HWND hwndInsertAfter)
 {
@@ -620,8 +619,6 @@
     HWND owner = GetWindow( hwnd, GW_OWNER );
     LONG style = GetWindowLongW( hwnd, GWL_STYLE );
  
-    WARN("(%p) hInsertAfter = %p\n", hwnd, hwndInsertAfter );
-
     if ((style & WS_POPUP) && owner)
     {
         /* make sure this popup stays above the owner */
@@ -655,9 +652,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-patches mailing list