Better add a comment what is done here exactly, some future reader might be confused.
perhaps "// fix event trap being removed from canvas, due to a problem in TrivialUndoManager"