If the sloppy menu popups - send the leave event to the last active
menu (except Cocoa), because only currect active menu gets enter/leave
events (currently Cocoa is an exception).
Check that the menu really has a mouse before hiding the sloppy menu -
don't rely on enter events.
This patch removes some unnecessary synthetic mouse enter/leave events
from QMenu which causes event duplications with different mouse cursor
position.
Refactor sloppy menu timer handling - start or restart timers on mouse
move events. Enter/leave events are not reliable.
Fixes:
- better enter/leave events handling for native widget actions,
- reduce duplicated enter/leave events for menu actions,
- better handle torn off sloppy menus.
Partially reverts: 0ed68f3f58
Amends: 57ecd5aeeb
Task-number: QTBUG-53068
Change-Id: I7ad56ac1619db124915d373fab82d0512d44c90e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>