``` tailrec fun Window.getParent(): Window { ...
# codereview
e
Copy code
tailrec fun Window.getParent(): Window {
        val parent = parentWindow
        return when {
            flags has Wf.ChildWindow && flags hasnt (Wf.Popup or Wf.ChildMenu) -> if(parent != null) getParent() else this
            else -> this
        }
    }
youtrack 3