MouseEnter WIN vs OSX?


#1

I am seeing a difference in MouseEnter and MouseExit, when I compare my application on Windows vs Mac OSX.

On Windows, MouseEnter and MouseExit fire when the very tip of the mouse enters/leaves the component.
But on OSX MouseEnter and MouseExit fire, when a point inside the mouse enters/leaves the component.

Is this intended behaviour, or am I doing something wrong?

The difference is only a few pixels. But it it is noticeable. Ideally, I would like my application to behave the same both on Windows and OSX.
In the attached screenshot you can see more clearly, what I mean.

I am using JUCE 5.3.2. And I tested on Windows 10 and on Mac OSX 10.11.6.


#2

JUCE just forwards on the mouse events directly from the OS so if there’s a difference between the two then it’ll be coming from the OS and not anything that JUCE is doing specifically. The difference could be due to rounding mouse coordinates - Windows uses an integer coordinate system whereas OSX is floating-point so that could account for some difference that you’re seeing, although I doubt it’d be as pronounced as in your image.


#3

As far as I remember this is a known difference between the two OS


#4

Also keep in mind, that the user can set custom mouse cursors, that’s why you have to specify the “hot spot pixel” with the mouse cursor.
So it is not only OS specific, but even user specific. You are at the mercy of the mouse cursor designer.


#5

#6

Thanks for your fast replies!

I was not aware, this is OS specific (and even user specific). Well, I guess I have to live with that then…