Commit d6a6055b authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

comctl32: Improve right-click handling in treeview controls.

parent aa158039
...@@ -4347,7 +4347,12 @@ TREEVIEW_RButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam) ...@@ -4347,7 +4347,12 @@ TREEVIEW_RButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
ht.pt.x = (short)LOWORD(lParam); ht.pt.x = (short)LOWORD(lParam);
ht.pt.y = (short)HIWORD(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)) if (TREEVIEW_TrackMouse(infoPtr, ht.pt))
{ {
...@@ -4368,6 +4373,13 @@ TREEVIEW_RButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam) ...@@ -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; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment