Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f68678f687 | ||
|
|
e31df6e721 | ||
|
|
9509a65625 |
15
main.go
15
main.go
@@ -21,7 +21,7 @@ import (
|
|||||||
"github.com/gotk3/gotk3/gtk"
|
"github.com/gotk3/gotk3/gtk"
|
||||||
)
|
)
|
||||||
|
|
||||||
const version = "0.3.1"
|
const version = "0.3.2"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
appDirs []string
|
appDirs []string
|
||||||
@@ -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()
|
||||||
win.Hide()
|
if win != nil {
|
||||||
|
win.Hide()
|
||||||
|
}
|
||||||
|
|
||||||
// clear search
|
// clear search
|
||||||
searchEntry.SetText("")
|
searchEntry.SetText("")
|
||||||
@@ -590,7 +595,9 @@ func restoreStateAndHide() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// scroll to the top
|
// scroll to the top
|
||||||
resultWindow.GetVAdjustment().SetValue(0)
|
if resultWindow != nil {
|
||||||
|
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()))
|
||||||
|
|||||||
Reference in New Issue
Block a user