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)
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.
On 8 Sep 2017, at 11:27 pm, Hugh McMaster wrote: 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.
More accurately, NM_RELEASEDCAPTURE is sent on left button down, but for case (2), the focus messages are sent first.
That doesn't explain why the messages are sent in the opposite order to Windows though.