It happens on macOS when the parent Component is added to desktop with the
Check the attached video: in the green component, the button hover animation works as expected when the component has focus (displayed with a white rectangle drawn inside the focused component).
On the other hand, in the red component the hover animation for the buttons never works, even after the component has been clicked to make it the focused one.
Curiosly enough, when the red component is clicked after the green, the green loses the focus as expected (the white rectangle inside disappears) but the red doesn’t gain it. And in this situation, the hover animation is still working for the buttons inside green (instead of those inside red, as it should)
The only difference between green and red is that green is added to desktop with addToDesktop (0), red with addToDesktop (juce::ComponentPeer::windowIgnoresKeyPresses).
Stepping with the debugger, it can be seen that the lack of hover animation is due to those buttons not receiving their mouseEnter/Exit events.
Code is also attached, simply create a new GUI project with Projucer and replace MainComponent.h/.cpp with those attached.
Tested on Catalina (Intel, of course).
Archive.zip (298.8 KB)