Correctly handle parents of sheets when accessing focused window