There are many reason why the user can't see your notifications also for example full screen video playback or that the user is just not there.
I suggest that instead of checking if the notification can be displayed check if the user is there, you can do that by monitoring the keyboard and mouse.