[PATCH v2 6/7] comctl32/button: Don't draw the button when losing focus before invalidating it

Gabriel Ivăncescu gabrielopcode at gmail.com
Tue Mar 5 07:13:28 CST 2019


It's already invalidated at the end so there's no reason to draw it before
that.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
 dlls/comctl32/button.c       | 1 -
 dlls/comctl32/tests/button.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index 16b36d4..f7497a1 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -770,7 +770,6 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
     case WM_KILLFOCUS:
         TRACE("WM_KILLFOCUS %p\n",hWnd);
         infoPtr->state &= ~BST_FOCUS;
-        paint_button( infoPtr, btn_type, ODA_FOCUS );
 
         if ((infoPtr->state & BUTTON_BTNPRESSED) && GetCapture() == hWnd)
             ReleaseCapture();
diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c
index ce673af..753aa24 100644
--- a/dlls/comctl32/tests/button.c
+++ b/dlls/comctl32/tests/button.c
@@ -600,11 +600,10 @@ static void test_button_messages(void)
         while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
         ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].setfocus, "SetFocus(hwnd) on a button", todo);
 
-        todo = button[i].style == BS_OWNERDRAW;
         SetFocus(0);
         SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
         while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
-        ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].killfocus, "SetFocus(0) on a button", todo);
+        ok_sequence(sequences, COMBINED_SEQ_INDEX, button[i].killfocus, "SetFocus(0) on a button", FALSE);
         ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
 
         SendMessageA(hwnd, BM_SETSTYLE, button[i].style | BS_BOTTOM, TRUE);
-- 
2.20.1




More information about the wine-devel mailing list