mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
desktop module use shutdown close.
This commit is contained in:
parent
d21cb9f336
commit
d46c5d9d30
@ -19,7 +19,7 @@ var mu = sync.Mutex{}
|
|||||||
type DesktopManagerCtx struct {
|
type DesktopManagerCtx struct {
|
||||||
logger zerolog.Logger
|
logger zerolog.Logger
|
||||||
wg sync.WaitGroup
|
wg sync.WaitGroup
|
||||||
shutdown chan bool
|
shutdown chan interface{}
|
||||||
emmiter events.EventEmmiter
|
emmiter events.EventEmmiter
|
||||||
config *config.Desktop
|
config *config.Desktop
|
||||||
}
|
}
|
||||||
@ -27,7 +27,7 @@ type DesktopManagerCtx struct {
|
|||||||
func New(config *config.Desktop) *DesktopManagerCtx {
|
func New(config *config.Desktop) *DesktopManagerCtx {
|
||||||
return &DesktopManagerCtx{
|
return &DesktopManagerCtx{
|
||||||
logger: log.With().Str("module", "desktop").Logger(),
|
logger: log.With().Str("module", "desktop").Logger(),
|
||||||
shutdown: make(chan bool),
|
shutdown: make(chan interface{}),
|
||||||
emmiter: events.New(),
|
emmiter: events.New(),
|
||||||
config: config,
|
config: config,
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ func (manager *DesktopManagerCtx) OnAfterScreenSizeChange(listener func()) {
|
|||||||
func (manager *DesktopManagerCtx) Shutdown() error {
|
func (manager *DesktopManagerCtx) Shutdown() error {
|
||||||
manager.logger.Info().Msgf("shutdown")
|
manager.logger.Info().Msgf("shutdown")
|
||||||
|
|
||||||
manager.shutdown <- true
|
close(manager.shutdown)
|
||||||
manager.wg.Wait()
|
manager.wg.Wait()
|
||||||
|
|
||||||
xorg.DisplayClose()
|
xorg.DisplayClose()
|
||||||
|
Loading…
Reference in New Issue
Block a user