diff options
| author | faiface <faiface2202@gmail.com> | 2019-05-09 14:28:25 +0200 |
|---|---|---|
| committer | faiface <faiface2202@gmail.com> | 2019-05-09 14:28:25 +0200 |
| commit | ba4fc4a57f9a38252f708f785f37aa24138dfe09 (patch) | |
| tree | 79bd9c19859933afe9cd792c0282dc77d292391f /mux.go | |
| parent | de5d2f5c78da7f8a578ecc25f8e8b1fa90f20264 (diff) | |
| download | gui-ba4fc4a57f9a38252f708f785f37aa24138dfe09.zip | |
change event strings to event types
Diffstat (limited to 'mux.go')
| -rw-r--r-- | mux.go | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -34,12 +34,10 @@ func NewMux(env Env) (mux *Mux, master Env) { go func() { for e := range env.Events() { - if e.Matches("resize/") { - mux.mu.Lock() - mux.lastResize = e - mux.mu.Unlock() - } mux.mu.Lock() + if resize, ok := e.(Resize); ok { + mux.lastResize = resize + } for _, eventsIn := range mux.eventsIns { eventsIn <- e } @@ -79,7 +77,7 @@ func (mux *Mux) makeEnv(master bool) Env { mux.eventsIns = append(mux.eventsIns, eventsIn) // make sure to always send a resize event to a new Env if we got the size already // that means it missed the resize event by the root Env - if mux.lastResize != "" { + if mux.lastResize != nil { eventsIn <- mux.lastResize } mux.mu.Unlock() |