Reset undo stack on deactivation instead of activation.