[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH] comctl32/listview: Keep the active item selected after hwndEdit is destroyed
From:       Nikolay Sivov <bunglehead () gmail ! com>
Date:       2017-08-17 20:37:00
Message-ID: d36c829a-ac18-fe51-1a38-5ecd2107b03a () gmail ! com
[Download RAW message or body]

On 10.08.2017 7:54, Hugh McMaster wrote:
> Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
> ---
> dlls/comctl32/listview.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
> index 73eceff509..05bd375571 100644
> --- a/dlls/comctl32/listview.c
> +++ b/dlls/comctl32/listview.c
> @@ -10216,6 +10216,7 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, \
> WORD wKey, INT x, IN static BOOL bGroupSelect = TRUE;
> POINT pt = { x, y };
> INT nItem;
> +  BOOL editing = FALSE;
> 
> TRACE("(key=%hu, X=%u, Y=%u)\n", wKey, x, y);
> 
> @@ -10309,11 +10310,20 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO \
> *infoPtr, WORD wKey, INT x, IN else
> {
> if (!infoPtr->bFocus)
> +    {
> +        editing = IsWindow(infoPtr->hwndEdit);
> SetFocus(infoPtr->hwndSelf);
> +    }
> 
> -    /* remove all selections */
> +    /* keep the active item selected after hwndEdit is destroyed, or deselect all \
> items */ if (!(wKey & MK_CONTROL) && !(wKey & MK_SHIFT))
> -        LISTVIEW_DeselectAll(infoPtr);
> +    {
> +        if (editing)
> +            LISTVIEW_DeselectAllSkipItem(infoPtr, infoPtr->nFocusedItem);
> +        else
> +            LISTVIEW_DeselectAll(infoPtr);
> +    }
> +

Maybe this could be reduced to a single unconditional call:

LISTVIEW_DeselectAllSkipItem(infoPtr, infoPtr->nEditLabelItem);

> ReleaseCapture();
> }
> 
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic