Merge pull request #73 from nwg-piotr/fix-72

Fix inconsistent behaviour of normal resident instance
This commit is contained in:
Piotr Miller
2022-10-30 23:54:41 +01:00
committed by GitHub

16
main.go
View File

@@ -21,7 +21,7 @@ import (
"github.com/gotk3/gotk3/gtk" "github.com/gotk3/gotk3/gtk"
) )
const version = "0.3.2" const version = "0.3.3"
var ( var (
appDirs []string appDirs []string
@@ -549,12 +549,14 @@ func main() {
fileSearchResultWrapper.Hide() fileSearchResultWrapper.Hide()
} }
// focus 1st element // focus 1st element
b := appFlowBox.GetChildAtIndex(0) var button gtk.IWidget
if b != nil { if pinnedFlowBox.GetChildren().Length() > 0 {
button, err := b.GetChild() button, err = pinnedFlowBox.GetChildAtIndex(0).GetChild()
if err == nil { } else {
button.ToWidget().GrabFocus() button, err = appFlowBox.GetChildAtIndex(0).GetChild()
} }
if err == nil {
button.ToWidget().GrabFocus()
} }
} }