Removed that annoying log message on window close
This commit is contained in:
parent
e3369ab3d4
commit
270b49f825
@ -201,9 +201,8 @@ func (window *Window) Hide () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (window *Window) Close () {
|
func (window *Window) Close () {
|
||||||
delete(window.backend.windows, window.xWindow.Id)
|
|
||||||
if window.onClose != nil { window.onClose() }
|
if window.onClose != nil { window.onClose() }
|
||||||
xevent.Detach(window.xWindow.X, window.xWindow.Id)
|
delete(window.backend.windows, window.xWindow.Id)
|
||||||
window.xWindow.Destroy()
|
window.xWindow.Destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@ type Backend struct {
|
|||||||
config config.Config
|
config config.Config
|
||||||
|
|
||||||
windows map[xproto.Window] *Window
|
windows map[xproto.Window] *Window
|
||||||
|
|
||||||
|
open bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBackend instantiates an X backend.
|
// NewBackend instantiates an X backend.
|
||||||
@ -40,6 +42,7 @@ func NewBackend () (output tomo.Backend, err error) {
|
|||||||
doChannel: make(chan func (), 0),
|
doChannel: make(chan func (), 0),
|
||||||
theme: theme.Default { },
|
theme: theme.Default { },
|
||||||
config: config.Default { },
|
config: config.Default { },
|
||||||
|
open: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// connect to X
|
// connect to X
|
||||||
@ -73,6 +76,9 @@ func (backend *Backend) Run () (err error) {
|
|||||||
// Stop gracefully closes the connection and stops the event loop.
|
// Stop gracefully closes the connection and stops the event loop.
|
||||||
func (backend *Backend) Stop () {
|
func (backend *Backend) Stop () {
|
||||||
backend.assert()
|
backend.assert()
|
||||||
|
if !backend.open { return }
|
||||||
|
backend.open = false
|
||||||
|
|
||||||
toClose := []*Window { }
|
toClose := []*Window { }
|
||||||
for _, window := range backend.windows {
|
for _, window := range backend.windows {
|
||||||
toClose = append(toClose, window)
|
toClose = append(toClose, window)
|
||||||
|
Reference in New Issue
Block a user