Hugh McMaster : comctl32: Improve right-click handling in treeview controls.
Alexandre Julliard
julliard at winehq.org
Thu Apr 13 13:06:08 CDT 2017
Module: wine
Branch: master
Commit: d6a6055bc95b701ccb5b439739b975330a4f67c4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d6a6055bc95b701ccb5b439739b975330a4f67c4
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>
---
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