Merge "Fix method for determining focused window." into klp-dev