Owen Rudge wrote:
Hi Nikolay,
This doesn't look right. Try with ControlSpy and you'll see
WM_SETFOCUS sent just after LButton pressed on
client area (not on item, that's important). LButtonUp event used to
set focus item was under mouse pointer and it's
released without any mouse movements (or maybe drag threshold doesn't
count).
I've just tested this with ControlSpy on wine with my patch,
NM_SETFOCUS is sent after LButton is released, when clicking on the
client area.
Exactly, and this isn't a case on native. It is sent on LButtonDown is
pressed not-on-item. Also you may want to look at message list for
ListView window (on wine it doesn't work and I mean native system here)
- after SetFocus() ListView get WM_SETFOCUS, it allows to determine when
we should to call SetFocus(), I'm not sure maybe NM_SETFOCUS is an
always forwarded WM_SETFOCUS...
It is also sent when clicking on an item and releasing the pointer
without any mouse movements, as you say. Possibly I'm misunderstanding
what you're saying here, but I'm not sure I see where the problem is?
Behaviour is, as far as I can tell, identical with my patch and
without it, with the exception of course of the NM_SETFOCUS if the
window does not already have focus.
This isn't a problem actually, it's difference in notification sequence.
On native focusing never depends on Mousemove and you're adding this
dependency.
Cheers,