comctl32/listview: Update focus rectangle properly

Nikolay Sivov bunglehead at gmail.com
Thu May 21 07:04:43 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=3235#c6

Focus rectangle wasn't updated when control window isn't focused.
That causes wrong drawing behaviour.

Steps to reproduce:
- focus an item (all control style should be affected)
- move focus from control window (focus rectangle cleared as expected)
- click on another item - this will draw both previous and new rectangles

Changelog:
    - Update focus rectangle properly

>From e558970606f36f1ffa3ab454219d4d2d4d826148 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Thu, 21 May 2009 15:55:47 +0400
Subject: Update focus rectangle properly

---
 dlls/comctl32/listview.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 7010a53..183d7a1 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -3974,7 +3974,8 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
 
     	if (nmlvcd.clrTextBk != CLR_NONE) 
             ExtTextOutW(hdc, rcSelect.left, rcSelect.top, ETO_OPAQUE, &rcSelect, 0, 0, 0);
-    	if(lprcFocus) *lprcFocus = rcSelect;
+	/* store new focus rectangle */
+	if (infoPtr->nFocusedItem == nItem) infoPtr->rcFocus = rcSelect;
     }
    
     /* figure out the text drawing flags */
-- 
1.5.6.5





More information about the wine-patches mailing list