close resident on SIGUSR1 if visible #31
This commit is contained in:
BIN
bin/nwg-drawer
BIN
bin/nwg-drawer
Binary file not shown.
5
main.go
5
main.go
@@ -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.
|
||||||
|
if !win.IsVisible() {
|
||||||
log.Debug("SIGUSR1 received, showing the window")
|
log.Debug("SIGUSR1 received, showing the window")
|
||||||
showWindowTrigger = true
|
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()
|
||||||
|
|||||||
Reference in New Issue
Block a user