Apps stealing focus

Have you had this happen to you before: You’re working on something – probably typing – when suddenly an app decides it needs your attention, so it just pushes a window to the foreground which was maybe even hidden before.

Consequently, your workflow has been interrupted, you need to attend to whatever it is the app wanted to inform you of, and you have to take a minute to get back to your previous line of thought.

Such a thing should never happen; in fact, the OS (window manager, to be exact) shouldn’t allow it. Users are supposed to have complete control over where their input goes, even more so when a text field has focus. This is a matter of security and privacy, as well, considering that passwords and sensitive information could end up in the wrong app.

Web browsers are especially violent offenders in this regard; even with an active pop-up blocker, pop-ups can show up out of nowhere and just steal your input focus. Indeed, a pop-up isn’t necessary for that; an embedded frame can just as easily transfer focus to one of its fields, or show an alert that you are forced to dismiss before continuing with anything. This is why JavaScript shouldn’t allow scripts to push a window to the foreground, nor steal focus from another input field.

This is also why the backspace key shouldn’t mean “go back to the last page.” Even after resolving these problems, a website might hide the focus ring to make its fields look prettier, causing users to believe a field to be in focus, and then inadvertently navigate to the previous page because they wanted to delete a word from a text input field. Getting thrown out of a web page is another loss of control users don’t want to experience.

See also: Notification bars