Revert "Fix window behavior when default button is present"

With some testing, found that even with the second patch
provided in #10792, the behaviour is still inconsistent, so
reverting for now.

This reverts commit 273109e0048442ba5f6361d6e683e5b4a69a472b.