Is there any way to detect an active modal operation?

Bummer, thanks for the effort in finding a way!