#3: Sending WM_SHOWWINDOW is a job of SetWindowPos

Dmitry Timoshkov dmitry at baikal.ru
Thu Apr 1 08:41:46 CST 2004


Hello,

Please apply after #2.

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    Sending WM_SHOWWINDOW is a job of SetWindowPos.

--- cvs/hq/wine/dlls/x11drv/winpos.c	2004-04-01 22:46:54.000000000 +0900
+++ wine/dlls/x11drv/winpos.c	2004-04-01 22:49:01.000000000 +0900
@@ -553,10 +553,20 @@ static BOOL SWP_DoWinPosChanging( WINDOW
 {
     WND *wndPtr;
 
+    if (pWinpos->flags & (SWP_SHOWWINDOW | SWP_HIDEWINDOW))
+    {
+        BOOL wasVisible, showFlag;
+
+        wasVisible = (GetWindowLongW(pWinpos->hwnd, GWL_STYLE) & WS_VISIBLE) != 0;
+        showFlag = !(pWinpos->flags & SWP_HIDEWINDOW);
+        if (showFlag != wasVisible)
+            SendMessageW(pWinpos->hwnd, WM_SHOWWINDOW, showFlag, 0);
+    }
+
     /* Send WM_WINDOWPOSCHANGING message */
 
     if (!(pWinpos->flags & SWP_NOSENDCHANGING))
-        SendMessageA( pWinpos->hwnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)pWinpos );
+        SendMessageW( pWinpos->hwnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)pWinpos );
 
     if (!(wndPtr = WIN_GetPtr( pWinpos->hwnd )) || wndPtr == WND_OTHER_PROCESS) return FALSE;
 
@@ -1256,7 +1266,7 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT
 BOOL X11DRV_ShowWindow( HWND hwnd, INT cmd )
 {
     WND* 	wndPtr = WIN_FindWndPtr( hwnd );
-    BOOL 	wasVisible, showFlag;
+    BOOL 	wasVisible;
     RECT 	newPos = {0, 0, 0, 0};
     UINT 	swp = 0;
 
@@ -1326,13 +1336,6 @@ BOOL X11DRV_ShowWindow( HWND hwnd, INT c
 	    break;
     }
 
-    showFlag = (cmd != SW_HIDE);
-    if (showFlag != wasVisible)
-    {
-        SendMessageA( hwnd, WM_SHOWWINDOW, showFlag, 0 );
-        if (!IsWindow( hwnd )) goto END;
-    }
-
     /* We can't activate a child window */
     if ((wndPtr->dwStyle & WS_CHILD) &&
         !(wndPtr->dwExStyle & WS_EX_MDICHILD))






More information about the wine-patches mailing list