With #89496 the ContextMenu got keyboard support
added. However, the underlying code does still
use only a click event to trigger the ContextMenu,
which is now also manually triggered for keypress
events. It was therefore not possible to differ
between the three possible ways, the ContextMenu
can be used:
1. Mouse click only
2. Mixed
2.1 Click on ContextMenu and navigate via keyboard
2.2 Access ContextMenu via keyboard and navigate via click
3. Keyboard only
Therefore, we now check the mouse position. If it's NULL,
the ContextMenu was openend via keyboard. Furthermore, we
use a boolean flag, which helps the getPosition method to
determine the correct position in mixed mode. Using mouse
click will now behave like before. Using the keyboard will
now always use the boundingRect for positioning.