This seems tto prevent the main window from keeping keyboard focus while the dialog is open (cherry picked from commit 4c322439)