[User32]
authorJames Tabor <james.tabor@reactos.org>
Wed, 16 Sep 2015 04:15:35 +0000 (04:15 +0000)
committerJames Tabor <james.tabor@reactos.org>
Wed, 16 Sep 2015 04:15:35 +0000 (04:15 +0000)
- Fix wine sync, Notify parent after capture is released, see CORE-10194.

svn path=/trunk/; revision=69249

reactos/win32ss/user/user32/controls/button.c

index f4c5959..939f58b 100644 (file)
@@ -398,6 +398,8 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
            break;
        /* fall through */
     case WM_LBUTTONUP:
            break;
        /* fall through */
     case WM_LBUTTONUP:
+    {
+        BOOL TellParent = FALSE; //// ReactOS see note below.
         state = get_button_state( hWnd );
         if (!(state & BUTTON_BTNPRESSED)) break;
         state &= BUTTON_NSTATES;
         state = get_button_state( hWnd );
         if (!(state & BUTTON_BTNPRESSED)) break;
         state &= BUTTON_NSTATES;
@@ -425,9 +427,11 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
                                 (state & BST_INDETERMINATE) ? 0 : ((state & 3) + 1), 0 );
                 break;
             }
                                 (state & BST_INDETERMINATE) ? 0 : ((state & 3) + 1), 0 );
                 break;
             }
-            BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED);
+            TellParent = TRUE; // <---- Fix CORE-10194, Notify parent after capture is released.
         }
         ReleaseCapture();
         }
         ReleaseCapture();
+        if (TellParent) BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED);
+    }
         break;
 
     case WM_CAPTURECHANGED:
         break;
 
     case WM_CAPTURECHANGED: