commit 7bf796be44985d263e42c8c8755dfdea80031166 parent 515f6fbcb62e35c9582ee8c1870a0f5145ef5b83 Author: cfillion <cfillion@users.noreply.github.com> Date: Sun, 29 Oct 2017 08:44:48 -0400 listview: limit icon click detection to the first column Diffstat:
M | src/listview.cpp | | | 5 | +++-- |
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/listview.cpp b/src/listview.cpp @@ -386,10 +386,11 @@ int ListView::itemUnderMouse(bool *overIcon) const LVHITTESTINFO info{}; GetCursorPos(&info.pt); ScreenToClient(handle(), &info.pt); - ListView_HitTest(handle(), &info); + ListView_SubItemHitTest(handle(), &info); if(overIcon) { - *overIcon = (info.flags & (LVHT_ONITEMICON | LVHT_ONITEMSTATEICON)) != 0 && + *overIcon = info.iSubItem == 0 && + (info.flags & (LVHT_ONITEMICON | LVHT_ONITEMSTATEICON)) != 0 && (info.flags & LVHT_ONITEMLABEL) == 0; }