Description
Steps to reproduce:
1) Launch the kitchen sink demo
2) Open an alert or prompt
3) Mouse down on the focused command button
Result:
The pressed state is not shown.
Analysis:
moveToFront() is being called on the root owner of the alert or prompt, causing a focus loss (followed by an immediate focus gain) on the push button. When the focus is lost, the pressed state is cleared. Thus, by the time paint() is called, the button thinks that it is not pressed.
Further, the moving of windows is causing the repaint region to be the entire display, even though only the button was pressed. This can be seen by enabling debug paints.
Suggestion:
In moveToFront(), could we somehow detect the order of windows that we hope to achieve, and if it's the same as the current order, make it a no-op?