aboutsummaryrefslogtreecommitdiffstats
path: root/mux.go
diff options
context:
space:
mode:
authorfaiface <faiface2202@gmail.com>2019-05-09 14:28:25 +0200
committerfaiface <faiface2202@gmail.com>2019-05-09 14:28:25 +0200
commitba4fc4a57f9a38252f708f785f37aa24138dfe09 (patch)
tree79bd9c19859933afe9cd792c0282dc77d292391f /mux.go
parentde5d2f5c78da7f8a578ecc25f8e8b1fa90f20264 (diff)
downloadgui-ba4fc4a57f9a38252f708f785f37aa24138dfe09.zip
change event strings to event types
Diffstat (limited to 'mux.go')
-rw-r--r--mux.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/mux.go b/mux.go
index c05b9ea..4198d61 100644
--- a/mux.go
+++ b/mux.go
@@ -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()