Ordinarily I love the peeking notifications in Marshmallow. They're really useful 95% of the time, and save me a lot of pulling down the notification shade.
But when a real-time game is in the foreground, the heads-up notifications block so much of the screen that they affect my ability to play. I have lost competitive events because of this. Enabling Do Not Disturb, oddly, does not prevent peeking; it only disables the vibration, which doesn't affect my gameplay. (It obviously also disables notification sounds, but my phone spends 99.9% of its life in vibration only mode.)
Obviously I could simply disable peeking, but that's not what I want. I want to suppress peeking only when certain apps are in the foreground. Googling for a solution has been fruitless, either because of keyword confusion or because a solution does not exist. I hope it's the former, and I just haven't been able to put the right query in.
Pretty much any solution is usable for me, since I am on rooted 6.0.1 with Xposed installed.