Fix incorrect foremost window detection (IDEA-121261).
Merge remote-tracking branch 'origin/master'