From c193c25b152d25150f07aa28a4d241f154e15716 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sun, 16 Jul 2023 00:56:13 -0400 Subject: [PATCH] Fix aforementioned logic --- box.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 {