You will know when enough is enough. True detachment comes when you are okay with either outcome.
It's harder with the kids, I understand. Like I said before, and I strive for this every minute of every day, be the BEST FATHER you can be and try to take comfort in the fact that your kids will know you did all that you knew how to do. They WILL know it.
We all have good days and bad ones. We can read in other peoples posts and see when they are having trouble and when things are okay. Up and down. My week has been the same; some up and some down.
Agree with her that D is the best thing. Don't push back. Let her spout her garbage and you go do something, anything with your kids. Get your mind off of her. I read it here a thousand times and only recently have been brave enough to say to her, "you're right, this M is over and I don't know why I have been fooling myself for so long." It works! I don't know if my M can be saved in the long run, but it throws them off of their game. They don't know what to say because they are so used to you trying to talk them out of it. When she's an a$$, let her be, don't ask what's wrong or try to help, leave her be and go do something else.
Come here and let out your feelings, but only show her strength and make her think you are okay. Soon enough, you will be okay no matter what. We will be okay.
Here's a quick man hug <h> !
Hang in there, you will be okay. Good, even. Don't doubt it for a second.