Cherry-pick the HandleEvent changes from the original vtable PR

Fix #2118