Focus stealing

In computing, focus stealing is a mode error occurring when a program not in focus (e.g. minimized or operating in background) places a window in the foreground and redirects all keyboard input to that window.

This is considered to be an annoyance or hazard to some users because the program may steal the focus while the user is typing, causing keystrokes to go to the newly focused window, possibly being lost or causing an unintended effect therein.

This may be a few keystrokes due to reaction time, or may be more if the user's attention is not on the computer screen, e.g. typing while looking at the keyboard or while reading copy to the side, or if processor lag causes a delay (sometimes of several seconds) between the focus stealing event and the newly focused window displaying on the screen.

Focus stealing can also on occasion cause security breaches, for example, when a user enters a password and the typed password appears instead in a new instant-messaging window in an unmasked input field.

Example of this behavior is Google Chrome using alert dialog, as documented in [4] The following web browsers allow focus stealing via a this.focus() JavaScript facility: Programs have been written to identify what is stealing focus.