attempt to fix #45 (revisited)

This commit is contained in:
piotr
2022-10-25 04:02:05 +02:00
parent bc84a05378
commit 9509a65625

View File

@@ -200,7 +200,10 @@ func main() {
log.Warnf("Resident instance already running (PID %v)", i) log.Warnf("Resident instance already running (PID %v)", i)
} else { } else {
log.Infof("Showing resident instance (PID %v)", i) 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() { func restoreStateAndHide() {
timeStart1 := time.Now() timeStart1 := time.Now()
if win != nil {
win.Hide() win.Hide()
}
// clear search // clear search
searchEntry.SetText("") searchEntry.SetText("")
@@ -590,7 +595,9 @@ func restoreStateAndHide() {
} }
// scroll to the top // scroll to the top
if resultWindow != nil {
resultWindow.GetVAdjustment().SetValue(0) resultWindow.GetVAdjustment().SetValue(0)
}
t := time.Now() t := time.Now()
log.Debugf(fmt.Sprintf("UI hidden and restored in the backgroud in %v ms", t.Sub(timeStart1).Milliseconds())) log.Debugf(fmt.Sprintf("UI hidden and restored in the backgroud in %v ms", t.Sub(timeStart1).Milliseconds()))