Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Prevent apps from stealing focus

Did anyone every come up with a solution to prevent applications from stealing focus from current window ?
Thanks,
Hotoru
block stop moving

MBP 13 Intel, Mac OS X (10.6.2)

Posted on Feb 7, 2010 8:31 AM

Reply
73 replies

Jun 21, 2012 4:54 AM in response to hotoru

I have this problem with many programs, but mainly Itunes. I will load up a selection of music (including music videos) and then minimise it to the taskbar or as a toolbar (specifically designed for continuous play without focus stealing). Sometimes when a new song starts (mainly the music videos) it will maximise and steal focus. This continual interruption has irked me enough to start looking for another music application. I suggest this problem be addressed... and soon!

Aug 17, 2012 1:34 PM in response to thomas_r.

Thomas A Reed wrote:


And none of you, responding to Mr. Hockman, are considering that the only apps involved in stealing focus in this case are Photoshop and some script? How exactly is this Apple's fault? It's not like the computer is doing it all by itself... either the script is bringing Photoshop to the front when finished or Photoshop is bringing itself to the front. Complaints need to be addressed to the appropriate party.


I've always wondered why responses like this are so frequent in the Apple support forums. Why is it that so many users with the highest score in Xbox Live Points, um sorry- Apple Forum Points, are also the users that never contribute anything to the discussion beyond ridicule and ignorance? "Apple represents perfection! Bugs are non-existant! If it's not working that means you're holding it wrong! I've never had that problem so it must not exist, liars! It's not Apple's fault, its (insert 3rd party here)'s fault!"


Hey Reed, two posts DIRECTLY before yours mentions iPhoto as a culprit for stealing focus (not Photoshop), and there have been plenty of posts mentioning other Apple software that also have this problem: Safari, iTunes, Final Cut, iPhoto, to name a few; as well as many other 3rd party apps beyond just Photoshop. It is very clearly an OS wide issue, not an application specific one. At the very least read a few posts before writing your jacka s s reply of how Apple can't possibly be the one to blame for a bug in their own software.


I too have been frustrated with this obnoxious problem for years. Finally decided to see if there was a solution or some kind of workaround out there. Unfortunately, as is usually the case when seeking help for Apple products, I find forum after forum of complaints on an issue followed by elite members of the Apple High Score Club ridiculing those users. Oh, and I found no fix or workaround but rather a handful of useless tips like, "Just use one program at a time on your $10k Mac Pro. Easy fix. Duh. " or "Don't use the program that's giving you trouble! Simple."


I've tried the Afloat app recommendation from earlier in the topic, (for anyone who stumbles on this thread), but it doesn't alleviate the problem. It's a cool app and adds some nice features but will not solve the ridiculous focus tug of war. Another possible solution I found dealt with modifying each individual app's "info.plist" that you want to launch in the background, but I haven't tried that one due to the number of issues that people were having in the comments and it removes the ability to cmd+tab to that application, which would only trade one workflow annoyance with another.


The short answer for those still looking is that preventing focus stealing can't be done in OSX. Period. That's the way it was designed and it's not likely to be changed by Apple any time soon. Why would Apple waste dev time on a bug fix that only a handful of power users who like to optimize their workflow would even notice, when they can release flashy features to the common crowd that sell more copies? It would be nice if a third party developer found a way to axe this, but I haven't found one yet. The search continues.


If anyone finds a solution, please post it!

Nov 13, 2012 1:37 PM in response to Lucas_D

Thanks for the link Lucas. Unfortunately those are the same methods that I mentioned already, which have too many issues for most people to even bother trying them, and many people claim they do not work anyway.


Using the Property List or Script/Automator modification to force an app to launch and stay in the background causes these problems (and maybe others as well):


- Prevents access to the app's menu bar, which appears next to the Apple logo at the top of your screen whenever an app is brought to the foreground.

- You will not be able to Command+Tab to an app that has been forced to remain in the background

- Some apps will not show the white dot on the dock when launched this way, indicating that it is running.

- Some apps can only be Force Closed when launched this way.

- Some apps require an intact code signature (modified plist will ruin this) and so the firewall will request your permission to run them each and every time. This behavior inherently brings the app to the foreground, which defeats the purpose of trying to force it into the background.

- Some apps cannot be brought to the foreground with any method after launching this way. (You won't be able to see that app's window on top of any others, even after clicking on the window.)


I've seen this advice posted in several places as a possible solution, but each place has a long list of comments from various people about the problems of trying it. Even the few success stories list more negative side effects than positive results. This isn't a viable solution for most people, given the additional problems it causes.

Nov 13, 2012 1:44 PM in response to TheKingArthur

Thanks, TheKingArthur. I didn't realize the method had already been mentioned, but anyway, your summary of the problems with it is helpful.


Just this morning, I started up Parallels, and then, while waiting for it to fully open, switched to a text editor and started writing down a dream I had last night, closing my eyes for better recall. When I finished writing down the dream, I opened my eyes, only to discover that I had typed nothing at all, because Parallels had stolen focus away from the text editor. Arghh!

Nov 13, 2012 2:47 PM in response to Lucas_D

No worries, the author from your link called the method something different than what I had posted above.


That describes exactly the frustration of this! Launch an app and while it's loading you decide to switch to something else and be productive rather than twiddle your thumbs, but the app you launch refuses to be ignored and so will jump back up front to remind you that its loading. Very frustrating, especially when it's an app that takes a while to load, which can grab focus from what you're doing 3 or 4 times before they finish. Argh.


You literally have to watch and wait for an app to finish launching in OSX before you can proceed to work. Multitasking is essentially disabled during this process.

Apr 11, 2013 8:20 AM in response to codingisallicareabout

Another current example: (I do NOT use Spaces) ClamXav has an option to open the (Console) log after it's done something such as scanning a predetermined folder, or updating itself with new definitions. Guess what? It pops open (a.k.a., steals focus to) the Console at least twice, every morning, or after connecting to a new network for the first time each day, regardless of whether Console is already open or not.


If Console isn't open, at least I can see it bounce in the Dock when it opens and I have been trained to wait for the 3-5 seconds it takes to open and produce the window. Twice. Every day, no matter what I'm doing. Now, I could turn off this notification, but when it needs an engine update, or senses an infected file, which has happened, I wouldn't know otherwise. I'm stuck between knowledge and interruption.


This is simply a software problem that could be fixed. 3rd party apps should utilize the system notifications that are now present, but even after 3 revs of 10.8, Apple apps have not done so.

Apr 11, 2013 12:57 PM in response to MadMacs0

I'm not certain how one would pull out an entire log file to place into a notification panel. I think that brings up a new set of challenges that actually takes us off into another direction.


I may still send suggestions for ClamXav, but my point is that the OS should intercept and either redirect these kinds of calls, or offer us an option of how we wish to be alerted. Having no option is not acceptable in today's current software environment. The scripting/rendering issues pointed out earlier in this thread that make a Mac unusable are egregious and sad examples of this problem that should be remedied by Apple, not 3rd party vendors.

Apr 11, 2013 2:06 PM in response to Matt W (TechnicalMac)

ClamXav Sentry has a Growl capability which gives me a bit more flexability on what notifications I get, but I am still in the process of moving everything from a PPC running Leopard to an iMac i7/Mountain Lion, so haven't had a chance to play with having Growl forward eveything to Notifications yet, but that might help with part of the problem.

Feb 11, 2015 1:00 PM in response to baltwo

I'm sorry, but this is bunk. If Im running Cinema 4D and a web browser and Cinema 4d tells me it needs to update, I don't need it to keep switching me back to Cinema 4D to tell me it's starting the update, then again to tell me the update has downloaded, then again to ask me to give admin to install it, then again to tell me it's installed and ask if I want language packs for languages I don't speak. You may have time to sit and patiently watch a loading bar for 45 minutes while an update downloads in order to avoid having the computer multitask but I don't know anyone else with that much free time.


A simple bouncing icon is more than enough to tell me n app needs attention and I'll get to it when I'm ready. Unless it's an emergency the system should NEVER EVER EVER choose what the user should be paying attention to and switch away from what I'm working on. The system may have gotten to a point where it needs user input on one app but it can wait. Disrupting a human train of thought for some trivial confirmation prompt should never happen at all.

May 13, 2016 7:27 AM in response to sewercat

Absolutely agree with those who find taking focus frustrating. Sometimes things like plugging in an iPhone to charge is a simple an innocuous activity. But doing so forces iTunes to the focus. Yeah, yeah, yeah, I know, tell iTunes to not sync on connect. But I DO want iTunes to sync on connect. But there is ZERO interaction I need to do for that to happen. Why should it pop to focus? Parallels is another application that is horrible for taking focus. Though I like the modifier idea for telling the OS to not take focus, I would propose a option for the modifier. Let me set my applications to default to NOT take focus and hold the modifier to give an application focus, or vice versa. Frankly, I rarely want an application to take focus. Alert me, sure, but not take focus.


My two cents.

Prevent apps from stealing focus

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.