ArticleslgStudy

science

Focus stealing

Focus stealing is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Focus stealing rather than just read about it. In short: 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 caus…

Key takeaways

  • Focus stealing belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Focus stealing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Focus stealing from memory before moving on to harder problems.

Reference excerpt

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 one keystroke due to an interaction interference, 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.

Security issues Focus stealing can cause damage, as users may, while typing when their attention is away from the screen, inadvertently agree to a program doing something that causes damage. For example, when Microsoft Windows pops up the Disk Cleanup wizard, the user may "agree" to deleting files without realizing that the wizard was waiting for input. 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.

Alternatives to focus stealing There are a number of alternative methods for grabbing the attention of the user that can be used instead of focus stealing:

Pulse the application's icon in the task bar, leaving the application in the background Output a message to the notification area Pulsate the display over scan area Use an audible alerting framework Show a pop-up, away from windows owned by the app that currently has the focus, and leave the focus (receiver of user inputs eg keyboard) with the application that currently has the focus and require active switch-focus-action from the user (eg windows click)

Affected systems

X Window Managers The following window manager systems allow focus stealing:

compiz - configurable, and capable of passing both the launch test and the JavaScript test fvwm - configurable, and capable of passing or failing both the launch test and the JavaScript test IceWM - fails the launch test, giving focus to newly started applications oroboros - fails the launch test, giving focus to newly started applications

Microsoft Windows Microsoft Windows-based systems use pop-up dialogue boxes which can steal focus from the current application. On versions of Microsoft Windows prior to Windows 7, there is a user setting that will by default prevent a cooperative application from stealing focus when launching another program or popping up a new window or dialogue box. This same method does not work in Windows 7 or later.

MacOS X Apple MacOS X systems also switch applications from background to foreground when the background applications uses pop-up modal dialogs. Example of this behavior is Google Chrome using alert dialog, as documented in

Web browsers The following web browsers allow focus stealing via a this.focus() JavaScript facility:

Mozilla Firefox Debian Iceweasel Debian Iceape Chrome Chromium Edge

Focus-stealing detection programs Programs have been written to identify what is stealing focus.

Process Explorer

See also Focus Mode (user interface) Window

References

External links Coding Horror: Please Don't Steal My Focus Microsoft's PowerToys for Windows XP The TweakUI utility has a setting to prevent programs from stealing the focus.

Worked examples

Example 1 — a first encounter with Focus stealing

Start with the simplest possible case. Write down what Focus stealing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Focus stealing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Focus stealing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Focus stealing

In research
Focus stealing appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Focus stealing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Focus stealing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Graphical user interfaces, so understanding it makes those chapters shorter.
In everyday life
Look for Focus stealing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Focus stealing” →

How to study Focus stealing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Focus stealing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Focus stealing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Focus stealing in simple terms?

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 ste…

Why does Focus stealing matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Focus stealing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Focus stealing.

Tags

  • Graphical user interfaces

Keep exploring