[2/5] comctl32/listview: Fix some hittest problems on LVS_EX_FULLROWSELECT

Nikolay Sivov bunglehead at gmail.com
Sun Jun 14 17:08:01 CDT 2009


Changelog:
    - this improves hittest to handle fullrowselect better

>From 328c723b4bc7b6beb4a9b556e139456a56bb4ff4 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Sun, 14 Jun 2009 20:40:42 +0400
Subject: Fix some hittest problems on LVS_EX_FULLROWSELECT

---
 dlls/comctl32/listview.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 2599abd..835f251 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -6643,6 +6643,8 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
 	/* for top/bottom only */
 	bounds.left = LVIR_BOUNDS;
 	LISTVIEW_GetItemRect(infoPtr, iItem, &bounds);
+	opt.x = lpht->pt.x - Origin.x;
+	opt.y = lpht->pt.y;
 
 	for (j = 0; j < DPA_GetPtrCount(infoPtr->hdpaColumns); j++)
 	{
@@ -6650,7 +6652,7 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
 	    bounds.left  = pRect->left;
 	    bounds.right = pRect->right;
 
-	    if (PtInRect(&bounds, lpht->pt))
+	    if (PtInRect(&bounds, opt))
 	    {
 		lpht->iSubItem = j;
 		break;
@@ -6676,7 +6678,11 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
     opt.y = lpht->pt.y - Position.y - Origin.y;
     
     if (infoPtr->uView == LV_VIEW_DETAILS)
+    {
 	rcBounds = rcBox;
+	if (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)
+	    opt.x = lpht->pt.x - Origin.x;
+    }
     else
     {
         UnionRect(&rcBounds, &rcIcon, &rcLabel);
-- 
1.5.6.5







More information about the wine-patches mailing list