I made a pop-up window component that can be automatically hide when clicking outside it. However, when I use it in Mac, its children won’t respond to mouseEnter and mouseExit events, thus all mouse hovering logics not work. But if I made a click on this pop-up window, its children will work properly with mouse enter/leave.
This issue is Mac-specific, it works well in Windows.
The code below is how this component is created and shown:
It appears that on macOS the mouseEnter and mouseExit events can be triggered for Components only if the window they’re in is the one that currently has focus.
I don’t think this is a restriction of the OS though, XCode, Firefox and a few other apss I’ve just tested have widgets that show hover states even without having focus.
Yep, thanks for updating this thread. I’ve updated the mouse handling in the NSViewComponentPeer so that it should behave a bit more like the mouse handling on Windows and Linux, so that mouse events will still reach unfocused windows.