user32: Paint button focus in the ODA_SELECT case too.

Dmitry Timoshkov dmitry at codeweavers.com
Tue May 18 00:29:23 CDT 2010


This patch makes sure that the button focus is also being painted when
holding mouse button and moving it from and back to button. In that case
we send BM_SETSTATE message, which in turn sends the ODA_SELECT event
to the button paint proc.
---
 dlls/user32/button.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/dlls/user32/button.c b/dlls/user32/button.c
index 8066e9e..54d54dc 100644
--- a/dlls/user32/button.c
+++ b/dlls/user32/button.c
@@ -833,8 +833,7 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
     SetTextColor( hDC, oldTxtColor );
 
 draw_focus:
-    if ((action == ODA_FOCUS) ||
-        ((action == ODA_DRAWENTIRE) && (state & BUTTON_HASFOCUS)))
+    if (action == ODA_FOCUS || (state & BUTTON_HASFOCUS))
     {
         InflateRect( &rc, -2, -2 );
         DrawFocusRect( hDC, &rc );
@@ -963,8 +962,7 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
 	BUTTON_DrawLabel(hwnd, hDC, dtFlags, &rtext);
 
     /* ... and focus */
-    if ((action == ODA_FOCUS) ||
-        ((action == ODA_DRAWENTIRE) && (state & BUTTON_HASFOCUS)))
+    if (action == ODA_FOCUS || (state & BUTTON_HASFOCUS))
     {
 	rtext.left--;
 	rtext.right++;
@@ -1072,8 +1070,7 @@ static void UB_Paint( HWND hwnd, HDC hDC, UINT action )
 					(WPARAM)hDC, (LPARAM)hwnd);
 
     FillRect( hDC, &rc, hBrush );
-    if ((action == ODA_FOCUS) ||
-        ((action == ODA_DRAWENTIRE) && (state & BUTTON_HASFOCUS)))
+    if (action == ODA_FOCUS || (state & BUTTON_HASFOCUS))
         DrawFocusRect( hDC, &rc );
 
     switch (action)
-- 
1.7.0.2




More information about the wine-patches mailing list