From 649455797912c883a3aa166d492bbcb344843712 Mon Sep 17 00:00:00 2001 From: piotr Date: Sun, 30 Oct 2022 22:53:06 +0100 Subject: [PATCH] focus 1st pinned if any, or focus 1st appBox entry; fixes #72 --- main.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 6b7b639..39ecd10 100644 --- a/main.go +++ b/main.go @@ -549,12 +549,14 @@ func main() { fileSearchResultWrapper.Hide() } // focus 1st element - b := appFlowBox.GetChildAtIndex(0) - if b != nil { - button, err := b.GetChild() - if err == nil { - button.ToWidget().GrabFocus() - } + var button gtk.IWidget + if pinnedFlowBox.GetChildren().Length() > 0 { + button, err = pinnedFlowBox.GetChildAtIndex(0).GetChild() + } else { + button, err = appFlowBox.GetChildAtIndex(0).GetChild() + } + if err == nil { + button.ToWidget().GrabFocus() } }