Hugh McMaster : comctl32: Improve right-click handling in treeview controls.

Alexandre Julliard julliard at winehq.org
Thu Jul 20 12:11:29 CDT 2017


Module: wine
Branch: stable
Commit: 9ee986cce4146fab330b3f7ebafef538eefb581a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9ee986cce4146fab330b3f7ebafef538eefb581a

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Tue Apr  4 12:42:49 2017 +0000

comctl32: Improve right-click handling in treeview controls.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit d6a6055bc95b701ccb5b439739b975330a4f67c4)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/comctl32/treeview.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index 74206bd..9a37cf3 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -4347,7 +4347,12 @@ TREEVIEW_RButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
     ht.pt.x = (short)LOWORD(lParam);
     ht.pt.y = (short)HIWORD(lParam);
 
-    TREEVIEW_HitTest(infoPtr, &ht);
+    if (TREEVIEW_HitTest(infoPtr, &ht))
+    {
+        infoPtr->focusedItem = ht.hItem;
+        TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem);
+        TREEVIEW_InvalidateItem(infoPtr, infoPtr->selectedItem);
+    }
 
     if (TREEVIEW_TrackMouse(infoPtr, ht.pt))
     {
@@ -4368,6 +4373,13 @@ TREEVIEW_RButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
 	}
     }
 
+    if (ht.hItem)
+    {
+        TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem);
+        infoPtr->focusedItem = infoPtr->selectedItem;
+        TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem);
+    }
+
     return 0;
 }
 




More information about the wine-cvs mailing list