Fixed an error when an owned window activates its owner during