diff --git a/box.go b/box.go index 5c9ca88..8bf244e 100644 --- a/box.go +++ b/box.go @@ -148,7 +148,10 @@ func (this *box) SetFocusable (focusable bool) { } func (this *box) Focused () bool { - return this.outer == this.parent.window().focused + if this.parent == nil { return false } + parentWindow := this.parent.window() + if parentWindow == nil { return false } + return this.outer == parentWindow.focused } func (this *box) Modifiers () input.Modifiers {