There isn't a way to determine (afaik) that the attention screen is going into "minimized" mode. So some threshold must be chosen to guess; I can make this clearer with comments, unless you have a less guessy idea on how to detect minimized mode.