Skip to content

Commit

Permalink
event: split SetCallerMap into its own interface for backwards compat…
Browse files Browse the repository at this point in the history
…ibility
  • Loading branch information
200sc committed Oct 9, 2021
1 parent 7139cc7 commit f777b0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions event/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ type Handler interface {
UnbindAll(Event)
UnbindAllAndRebind(Event, []Bindable, CID, []string)
UnbindBindable(UnbindOption)
}

// A CallerMapper has an internal caller map that can be set.
type CallerMapper interface {
SetCallerMap(*CallerMap)
}

Expand Down
4 changes: 3 additions & 1 deletion sceneLoop.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ func (w *Window) sceneLoop(first string, trackingInputs bool) {
} else {
w.CallerMap = event.NewCallerMap()
}
w.eventHandler.SetCallerMap(w.CallerMap)
if cmr, ok := w.eventHandler.(event.CallerMapper); ok {
cmr.SetCallerMap(w.CallerMap)
}
w.DrawStack.Clear()
w.DrawStack.PreDraw()

Expand Down

0 comments on commit f777b0d

Please sign in to comment.