comctl32: listview[1/2]: don't edit labels on click if the view was not focused

Mikołaj Zalewski mikolaj at zalewski.pl
Wed Sep 13 06:06:52 CDT 2006


-------------- next part --------------
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 239a4cd..df306a8 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -8253,6 +8253,7 @@ static LRESULT LISTVIEW_LButtonDown(LIST
 {
   LVHITTESTINFO lvHitTestInfo;
   static BOOL bGroupSelect = TRUE;
+  BOOL bReceivedFocus = FALSE;
   POINT pt = { x, y };
   INT nItem;
 
@@ -8261,7 +8262,11 @@ static LRESULT LISTVIEW_LButtonDown(LIST
   /* send NM_RELEASEDCAPTURE notification */
   if (!notify(infoPtr, NM_RELEASEDCAPTURE)) return 0;
 
-  if (!infoPtr->bFocus) SetFocus(infoPtr->hwndSelf);
+  if (!infoPtr->bFocus)
+  {
+    bReceivedFocus = TRUE;
+    SetFocus(infoPtr->hwndSelf);
+  }
 
   /* set left button down flag and record the click position */
   infoPtr->bLButtonDown = TRUE;
@@ -8348,6 +8353,9 @@ static LRESULT LISTVIEW_LButtonDown(LIST
     LISTVIEW_DeselectAll(infoPtr);
     ReleaseCapture();
   }
+  
+  if (bReceivedFocus)
+    infoPtr->nEditLabelItem = -1;
 
   return 0;
 }
-- 
1.4.1


More information about the wine-patches mailing list