From 9509a6562572ceea7cd9ffc27b8929e3c9254e9b Mon Sep 17 00:00:00 2001 From: piotr Date: Tue, 25 Oct 2022 04:02:05 +0200 Subject: [PATCH 1/2] attempt to fix #45 (revisited) --- main.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 52882bf..1d7b751 100644 --- a/main.go +++ b/main.go @@ -200,7 +200,10 @@ func main() { log.Warnf("Resident instance already running (PID %v)", i) } else { log.Infof("Showing resident instance (PID %v)", i) - syscall.Kill(i, syscall.SIGUSR1) + err := syscall.Kill(i, syscall.SIGUSR1) + if err != nil { + return + } } } } @@ -577,7 +580,9 @@ func main() { func restoreStateAndHide() { timeStart1 := time.Now() - win.Hide() + if win != nil { + win.Hide() + } // clear search searchEntry.SetText("") @@ -590,7 +595,9 @@ func restoreStateAndHide() { } // scroll to the top - resultWindow.GetVAdjustment().SetValue(0) + if resultWindow != nil { + resultWindow.GetVAdjustment().SetValue(0) + } t := time.Now() log.Debugf(fmt.Sprintf("UI hidden and restored in the backgroud in %v ms", t.Sub(timeStart1).Milliseconds())) From e31df6e7211931d0d888522262a84f4482eb96e5 Mon Sep 17 00:00:00 2001 From: piotr Date: Tue, 25 Oct 2022 04:06:30 +0200 Subject: [PATCH 2/2] bump to 0.3.2 --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 1d7b751..6b7b639 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,7 @@ import ( "github.com/gotk3/gotk3/gtk" ) -const version = "0.3.1" +const version = "0.3.2" var ( appDirs []string