doMouseDown always trigger doMouseMove


#1

Hello!
Why is doMouseMove always called from Win32ComponentPeer::doMouseDown?
Is this a design choice? (It is counter-intuitive for me since the mouse has not moved.)


#2

What a strange question! Why on earth would it matter?!

I presume it’s in there to deal with situations where the mouse enters a window and clicks before it’s had time to get a real mouse move, so that it can send the correct mouseEnter/cursor update/etc calls if it needs to, before doing the mouse-down. I can think of a dozen other obscure reasons why it might be necessary… but as a user, don’t worry about it!


#3

Hello and thanks for the quick reply!
The reason I wrote was because I was debugging and I didn’t understand why I got a certain behaviour.

It’s a detail, but it also has cross platform implications.
For instance if someone is doing gui invalidation using repaint() in mouseMove / mouseDown, and
miss something when implementing mouseDown, then it will seem to work fine on windows,
but be broken if compiled on mac.


#4

Hmm, I suppose so, though you’d have to be writing extremely brittle code to get caught out by something that subtle!