diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 7eee2fb..b2e5dc9 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -153,6 +153,9 @@ static void
 
 static WMMsgNodePtr PopMessage(WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo);
 
+static Bool
+ HaveMessage(WMMsgQueuePtr pQueue, UINT msg, xcb_window_t iWindow);
+
 static Bool
  InitQueue(WMMsgQueuePtr pQueue);
 
@@ -319,7 +322,6 @@ PopMessage(WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo)
     return pNode;
 }
 
-#if 0
 /*
  * HaveMessage -
  */
@@ -331,12 +333,11 @@ HaveMessage(WMMsgQueuePtr pQueue, UINT msg, xcb_window_t iWindow)
 
     for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext) {
         if (pNode->msg.msg == msg && pNode->msg.iWindow == iWindow)
-            return True;
+            return TRUE;
     }
 
-    return False;
+    return FALSE;
 }
-#endif
 
 /*
  * InitQueue - Initialize the Window Manager message queue
@@ -748,12 +749,12 @@ UpdateStyle(WMInfoPtr pWMInfo, xcb_window_t iWindow, unsigned long *maxmin)
  */
 
 static void
-UpdateState(WMInfoPtr pWMInfo, xcb_window_t iWindow, int state)
+UpdateState(WMInfoPtr pWMInfo, xcb_window_t iWindow, int state, BOOL bShow)
 {
     HWND hWnd;
     int current_state = -1;
 
-    winDebug("UpdateState: iWindow 0x%08x %d\n", (int)iWindow, state);
+    winDebug("UpdateState: iWindow 0x%08x %d %d\n", (int)iWindow, state, (int) bShow);
 
     hWnd = getHwnd(pWMInfo, iWindow);
     if (hWnd)
@@ -764,29 +765,36 @@ UpdateState(WMInfoPtr pWMInfo, xcb_window_t iWindow, int state)
             if (current_state == state)
                 return;
 
+            // There would be small interval that variable 'state' does not
+            // match to Windows window state if bShow==0
+            // But meanwhile there should be a another WM_WM_CHANGE pending
+            // and soon the Windows state will be updated
             SetProp(hWnd, WIN_STATE_PROP, (HANDLE)(intptr_t)state);
 
-            switch (state)
-                {
-                case XCB_ICCCM_WM_STATE_ICONIC:
-                    ShowWindow(hWnd, SW_SHOWMINNOACTIVE);
-                    break;
-
-#define XCB_ICCCM_WM_STATE_ZOOM 2
-                case XCB_ICCCM_WM_STATE_ZOOM:
-                    // There doesn't seem to be a SW_SHOWMAXNOACTIVE.  Hopefully
-                    // always activating a maximized window isn't so bad...
-                    ShowWindow(hWnd, SW_SHOWMAXIMIZED);
-                    break;
-
-                case XCB_ICCCM_WM_STATE_NORMAL:
-                    ShowWindow(hWnd, SW_SHOWNOACTIVATE);
-                    break;
-
-                case XCB_ICCCM_WM_STATE_WITHDRAWN:
-                    ShowWindow(hWnd, SW_HIDE);
-                    break;
-                }
+            if(bShow) {
+
+                switch (state)
+                    {
+                    case XCB_ICCCM_WM_STATE_ICONIC:
+                        ShowWindow(hWnd, SW_SHOWMINNOACTIVE);
+                        break;
+
+    #define XCB_ICCCM_WM_STATE_ZOOM 2
+                    case XCB_ICCCM_WM_STATE_ZOOM:
+                        // There doesn't seem to be a SW_SHOWMAXNOACTIVE.  Hopefully
+                        // always activating a maximized window isn't so bad...
+                        ShowWindow(hWnd, SW_SHOWMAXIMIZED);
+                        break;
+
+                    case XCB_ICCCM_WM_STATE_NORMAL:
+                        ShowWindow(hWnd, SW_SHOWNOACTIVATE);
+                        break;
+
+                    case XCB_ICCCM_WM_STATE_WITHDRAWN:
+                        ShowWindow(hWnd, SW_HIDE);
+                        break;
+                    }
+            }
         }
 
     // Update WM_STATE property
@@ -1012,7 +1020,7 @@ winMultiWindowWMProc(void *pArg)
             UpdateWindow(pNode->msg.hwndWindow);
 
             /* Establish initial state */
-            UpdateState(pWMInfo, pNode->msg.iWindow, XCB_ICCCM_WM_STATE_NORMAL);
+            UpdateState(pWMInfo, pNode->msg.iWindow, XCB_ICCCM_WM_STATE_NORMAL, TRUE);
 
             /*
               It only makes sense to apply minimize/maximize override as the
@@ -1173,7 +1181,11 @@ winMultiWindowWMProc(void *pArg)
             break;
 
         case WM_WM_CHANGE_STATE:
-            UpdateState(pWMInfo, pNode->msg.iWindow, pNode->msg.dwID);
+            if(HaveMessage(&pWMInfo->wmMsgQueue, pNode->msg.msg, pNode->msg.iWindow))
+                UpdateState(pWMInfo, pNode->msg.iWindow, pNode->msg.dwID, FALSE);
+            else
+                UpdateState(pWMInfo, pNode->msg.iWindow, pNode->msg.dwID, TRUE);
+
             break;
 
         default:
