Fix windows systray icon just hanging out (#2330)

This commit is contained in:
kermieisinthehouse 2022-02-17 20:03:41 -08:00 committed by GitHub
parent 358545579a
commit 36ce75c8c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 3 deletions

2
go.mod
View File

@ -51,7 +51,7 @@ require (
github.com/go-chi/httplog v0.2.1 github.com/go-chi/httplog v0.2.1
github.com/go-toast/toast v0.0.0-20190211030409-01e6764cf0a4 github.com/go-toast/toast v0.0.0-20190211030409-01e6764cf0a4
github.com/kermieisinthehouse/gosx-notifier v0.1.1 github.com/kermieisinthehouse/gosx-notifier v0.1.1
github.com/kermieisinthehouse/systray v1.2.3 github.com/kermieisinthehouse/systray v1.2.4
github.com/lucasb-eyer/go-colorful v1.2.0 github.com/lucasb-eyer/go-colorful v1.2.0
github.com/vearutop/statigz v1.1.6 github.com/vearutop/statigz v1.1.6
github.com/vektah/gqlparser/v2 v2.0.1 github.com/vektah/gqlparser/v2 v2.0.1

2
go.sum
View File

@ -498,6 +498,8 @@ github.com/kermieisinthehouse/gosx-notifier v0.1.1 h1:lVXyKsa1c1RUkckp3KayloNLoI
github.com/kermieisinthehouse/gosx-notifier v0.1.1/go.mod h1:xyWT07azFtUOcHl96qMVvKhvKzsMcS7rKTHQyv8WTho= github.com/kermieisinthehouse/gosx-notifier v0.1.1/go.mod h1:xyWT07azFtUOcHl96qMVvKhvKzsMcS7rKTHQyv8WTho=
github.com/kermieisinthehouse/systray v1.2.3 h1:tawLahcam/Ccs/F2n6EOQo8qJnSTD2hLzOYqTGsUsbA= github.com/kermieisinthehouse/systray v1.2.3 h1:tawLahcam/Ccs/F2n6EOQo8qJnSTD2hLzOYqTGsUsbA=
github.com/kermieisinthehouse/systray v1.2.3/go.mod h1:axh6C/jNuSyC0QGtidZJURc9h+h41HNoMySoLVrhVR4= github.com/kermieisinthehouse/systray v1.2.3/go.mod h1:axh6C/jNuSyC0QGtidZJURc9h+h41HNoMySoLVrhVR4=
github.com/kermieisinthehouse/systray v1.2.4 h1:pdH5vnl+KKjRrVCRU4g/2W1/0HVzuuJ6WXHlPPHYY6s=
github.com/kermieisinthehouse/systray v1.2.4/go.mod h1:axh6C/jNuSyC0QGtidZJURc9h+h41HNoMySoLVrhVR4=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=

View File

@ -87,6 +87,7 @@ func systrayInitialize(shutdownHandler ShutdownHandler, faviconProvider FaviconP
openURLInBrowser("") openURLInBrowser("")
} }
case <-quitStashButton.ClickedCh: case <-quitStashButton.ClickedCh:
systray.Quit()
shutdownHandler.Shutdown(0) shutdownHandler.Shutdown(0)
} }
} }

View File

@ -811,7 +811,17 @@ func nativeLoop() {
} }
func quit() { func quit() {
const WM_CLOSE = 0x0010 const (
WM_ENDSESSION = 0x0016
WM_CLOSE = 0x0010
)
pPostMessage.Call(
uintptr(wt.window),
WM_ENDSESSION,
0,
0,
)
pPostMessage.Call( pPostMessage.Call(
uintptr(wt.window), uintptr(wt.window),

2
vendor/modules.txt vendored
View File

@ -231,7 +231,7 @@ github.com/json-iterator/go
# github.com/kermieisinthehouse/gosx-notifier v0.1.1 # github.com/kermieisinthehouse/gosx-notifier v0.1.1
## explicit ## explicit
github.com/kermieisinthehouse/gosx-notifier github.com/kermieisinthehouse/gosx-notifier
# github.com/kermieisinthehouse/systray v1.2.3 # github.com/kermieisinthehouse/systray v1.2.4
## explicit; go 1.17 ## explicit; go 1.17
github.com/kermieisinthehouse/systray github.com/kermieisinthehouse/systray
# github.com/lucasb-eyer/go-colorful v1.2.0 # github.com/lucasb-eyer/go-colorful v1.2.0