From b0852f76801d980782d3bbe7c3a8929e88ab2959 Mon Sep 17 00:00:00 2001 From: Piotr Miller Date: Thu, 17 Jun 2021 13:24:03 +0200 Subject: [PATCH] Focus 1st pinned item or 1st found app icon --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.go b/main.go index 3ff5b92..f2aeee2 100644 --- a/main.go +++ b/main.go @@ -311,6 +311,15 @@ func main() { resultsWrapper.PackStart(appSearchResultWrapper, false, false, 0) appFlowBox = setUpAppsFlowBox(nil, "") + // Focus 1st pinned item if any, otherwise focus 1st found app icon + var button gtk.IWidget + if pinnedFlowBox.GetChildren().Length() > 0 { + button, _ = pinnedFlowBox.GetChildAtIndex(0).GetChild() + } else { + button, _ = appFlowBox.GetChildAtIndex(0).GetChild() + } + button.ToWidget().GrabFocus() + userDirsMap = mapXdgUserDirs() placeholder, _ := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 0)