``` tailrec fun Window.getParent(): Window { ...
# codereview
e
Copy code
tailrec fun Window.getParent(): Window {
        return when {
            flags has Wf.ChildWindow && flags hasnt (Wf.Popup or Wf.ChildMenu) -> parentWindow?.getParent() ?: this
            else -> this
        }
    }