Piotr Caban : comctl32: Set listview focus in WM_LBUTTONDOWN.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Dec 2 10:21:18 CST 2015


Module: wine
Branch: master
Commit: ddcab8aceada5ee7df8bbd3d9c04de4ce5a25725
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ddcab8aceada5ee7df8bbd3d9c04de4ce5a25725

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Dec  1 19:12:41 2015 +0100

comctl32: Set listview focus in WM_LBUTTONDOWN.

This patch reverts commit 098dc7b3302f39c5500d644615a6f4c37d328ce0 and
moves focus setting after LVN_ITEMCHANGED notification is sent. Writing
tests for it is tricky because native blocks inside WM_LBUTTONDOWN message.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index e479dca..68a5515 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -10266,6 +10266,9 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
       }
     }
 
+    if (!infoPtr->bFocus)
+        SetFocus(infoPtr->hwndSelf);
+
     if (infoPtr->dwLvExStyle & LVS_EX_ONECLICKACTIVATE)
         if(lvHitTestInfo.iItem != -1) notify_itemactivate(infoPtr,&lvHitTestInfo);
   }
@@ -10352,9 +10355,6 @@ static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT
             LISTVIEW_DelayedEditItem);
     }
 
-    if (!infoPtr->bFocus)
-        SetFocus(infoPtr->hwndSelf);
-
     return 0;
 }
 




More information about the wine-cvs mailing list