Merge pull request #32 from nwg-piotr/fix31

Hide resident window on SIGUSR1 if visible
This commit is contained in:
Piotr Miller
2021-10-01 00:03:39 +02:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

Binary file not shown.

View File

@@ -162,8 +162,13 @@ func main() {
if *resident { if *resident {
// As win.Show() called from inside a goroutine randomly crashes GTK, // As win.Show() called from inside a goroutine randomly crashes GTK,
// let's just set e helper variable here. We'll be checking it with glib.TimeoutAdd. // let's just set e helper variable here. We'll be checking it with glib.TimeoutAdd.
log.Debug("SIGUSR1 received, showing the window") if !win.IsVisible() {
showWindowTrigger = true log.Debug("SIGUSR1 received, showing the window")
showWindowTrigger = true
} else {
log.Debug("SIGUSR1 received, hiding the window")
restoreStateAndHide()
}
} else { } else {
log.Info("SIGUSR1 received, and I'm not resident, bye bye") log.Info("SIGUSR1 received, and I'm not resident, bye bye")
gtk.MainQuit() gtk.MainQuit()