[PATCH] comctl32/listview: Send NM_RELEASEDCAPTURE after the window focus has changed

Hugh McMaster hugh.mcmaster at outlook.com
Fri Sep 8 08:27:15 CDT 2017


On Friday, 8 September 2017 6:48 PM, Nikolay Sivov wrote:
> What use case does this fix? With this patch notification order is more
> broken than without.
>
> On Windows when clicking on item of unfocused control gives roughly:
>
> NM_RELEASEDCAPTURE
> LVN_ITEMCHANGING/LVN_ITEMCHANGED
> NM_CUSTOMDRAW
> NM_SETFOCUS
> NM_CLICK
>
> Without this patch we currently do:
>
> NM_RELEASEDCAPTURE
> LVN_ITEMCHANGIN/LVN_ITEMCHANGED
> NM_SETFOCUS
> NM_CLICK
>
> With the patch:
>
> LVN_ITEMCHANGING/LVN_ITEMCHANGED
> NM_SETFOCUS
> NM_RELEASECAPTURE
> NM_CLICK
>
> (in both cases on Wine sequence is interleaved with some NM_CUSTOMDRAW)

Yes, I agree. But if you test edit a label and then exit edit mode (e.g. by clicking 
in blank space on the control), the results are quite different. It seems like 
NM_RELEASEDCAPTURE is sent twice -- (1) on left down to activate editing and 
(2) after editing is finished and focus restored.

*** Windows ***
NM_RELEASEDCAPTURE <-- left click to start editing
LVN_ITEMCHANGING
NM_CLICK
LVN_BEGINLABELEDIT
NM_KILLFOCUS
edit set focus
LVN_ENDLABELEDIT <-- left click in blank space to end editing
edit kill focus
NM_SETFOCUS
edit destroy
NM_RELEASEDCAPTURE

*** Wine ***
NM_RELEASEDCAPTURE <-- left click to start editing
NM_CLICK
LVN_ITEMCHANGING
LVN_ITEMCHANGING
LVN_BEGINLABELEDIT
NM_KILLFOCUS
edit set focus
NM_RELEASEDCAPTURE <-- left click in blank space to end editing
edit kill focus
LVN_ENDLABELEDIT
LVN_ITEMCHANGING
edit destroy
NM_SETFOCUS
LVN_ITEMCHANGING
LVN_ITEMCHANGING
NM_CLICK

The message order on Wine is opposite to that on Windows when 
ending edit mode with the mouse. But it is correct if you press 
Return or Escape on the keyboard.



More information about the wine-devel mailing list