MainWindowChanged
Revert "MainWindowChanged"

This reverts commit 033507a2043a7be0abd12bef9538b3e7d4424b56.
Revert "Revert "MainWindowChanged""

This reverts commit 9277825b51572969fef5e2ff5d1c3a0629c92259.