Don't steal focus

Answered

Most every morning I sit down, start up my computer and start up all the programs I will be working with that day. I usually proceed to read my email first. Unfortunately, Intellij, like so many products, thinks it is the most important program ever and it must have my attention. So it steals focus and puts itself right in my face. However, I tend to have between 2-4 projects open in different windows. So it does this not only once but for each project.

IMO there is never a case for focus stealing. One could make a case for security software which may have a legitimate need to demand direct action. I also think such a case has never occurred in my life. I suppose any kind of alarm program could make the case. I still wouldn't agree, but I can see that some people would. However IntelliJ has no case whatsoever to steal focus. Focus should be on what I am focussed on. Just because I started the IDE does not mean I intend to work with it right now. Untill someone implements a telepathic focus algorithm programs should just start up in the background and let me continue with whatever I am doing.

85 comments

I think the problem is that most don't understand the issue, it's perfectly normal that a program steal focus on start.

The problem with intellij is that it does so several time!

Not only one time on start, but: when just started and showing the splash/laoding-screen, another time when the project open itself, then again several times (indexing finished or other event).

It's really a pain, I usually start intellij and then do other stuff/start other program while intellij load.

For example my mail client, and I'm always interrupt by intellij while typing my password in the mail client...

3

For the meantime, maybe some (X11) workaround:

idea.sh "/path/to/project" nosplash & for i in {1,2}; do xdotool search --sync --onlyvisible --desktop 0 --class jetbrains-idea windowminimize; done

this attempts to minimize the `jetbrains-idea` class window twice: the project chooser and the actual editor.

0

Would realy appreciate if this could be fixed. It's annoying and unnecessary!

2

Exactly what @Romain Rinie said. This doesn't just happen on startup, but also on other occasions. Plus I have to switch between different projects regularly so this increases the times it happens. This happens to me at least twice a day that I type something in another window (most of the times my terminal) and all over sudden Pycharm steals focus and I end up typing in whatever file is open there. I really like your IDE but this is driving me nuts and makes me seriously thinking about switching the IDE. This is open since nearly four years now. Is this really this big of an issue to fix? Please please please fix this

1

The focus stealing is the most annoying part of the product. Would not be a problem if it would boot up faster though ;). I already tried forcing no program to ever focus-steal (using my window manager), but that also disallows popup messages to steal focus, which is even more annoying. Please, Jetbrains, fix this!

1

1. I use the launcher (JetBrains Toolbox) to launch IDEA. Why does it show extra splashscreen, for which purpose? Why the toolbox cannot show startup-progress inside a closable window - ?!

2. For new users, add the close-window button to splashscreen and allow to **close the splashscreen** once and for all, without looking where it should be configured in Ubuntu/Unity/whatever and trying "nosplash", "-nosplash", "--nosplash" with no result.

3. don't steal focus multiple times, how many years are needed to fix this?

2

Hi. We have a feature request to allow turning splash screen off, please upvote:

https://youtrack.jetbrains.com/issue/IDEA-72664

0

Petr, the issue here isn't necessarily the splash screen. (Though it would be a step in the right direction.)

For Mac users, if you have a few projects open in IntelliJ or Clion, it will switch active screens for every single project. So basically, while booting into Mac, I will see my screen fly left and right for maybe 1-2 minutes while all the workspaces open up again. During this focus stealing, I can't really use my MacBook.

I know its possible to avoid doing this, as other applications don't steal focus when they restore their state after a new login.

0

Thanks Serge. Seems to be exactly what I meant. I'm glad some progress is being made with the experimental registry values in the last few weeks.

I'll keep watching IDEA-107264.

0

Same here, focus stealing is annoying as hell. This is how I found this thread, I was so pissed at PHPStorm because it stole focus about 6 times and Ive went searching for a solution. At first I thought that its OS related, but now I see it is not. Please fix this issue. Like many other I like to push on an icon while my current projects will boot up and go read emails or do some other stuff, but that focus grabbing makes it so freakin annoying. Ive ran out of patience :D so I found this thread.

0

I Agree with Vytenis. I want to start PHPStorm and during startup read mails...

 

+1

1

Sometimes when indexing or searching you start some chat and when PhpStorm captures focus you will end up writting shit into your code. I see this issue as a major fault.

1

Vytenis, glad to know I'm not the only one!

1

Fixed the stealing focus problem, but now when it starts it's no where to be found, e.g. hidden until I tab through the running applications and can select it. Which is even more aggravating than the steal focus at startup problem.

1

Finally changed this, thanks JetBrains for listening to your users! :-)

0

The attempt to fix this behavior in the last release (2018.2) made it even worse. Now I can't switch to IDEA without minimizing all other windows. I use KDE Plasma 5.12.

1

Try adding "suppress.focus.stealing=false" to Help | Edit Custom Properties action.

If issue remains file a but at https://youtrack.jetbrains.com/issues/IDEA  with the exact steps that reproduce it for you and attach idea.log after IDE restart.

2

This has broken again after upgrading to 2018.3. Created an issue for that (https://youtrack.jetbrains.com/issue/WEB-36327).

0

"suppress.focus.stealing=false" does not work on Ubuntu for latest android studio too. 

Android Studio 3.2.1
Build #AI-181.5540.7.32.5056338, built on October 9, 2018
JRE: 1.8.0_152-release-1136-b06 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 3.19.0-47-generic

This is too annoying.

0

On the same line about focus. I am not sure if it's just me or happens to someone else. I am running Idea on Mac OSX, I have open Files and a Terminal on Idea on a regular basis. Every time I click on the Terminal space to type command coming from any other application, for example web browser of finder itself. Idea focus on the open file instead of the clicked space "The Terminal", so of course I click and type immediately, finding that I have mistakenly wrote shell commands and enter commands on the open file. this is really annoying.

 

Best,

 

-Martin

0

Yes, I also agree. PhpStorm should not steal focus when starting up. Even after it steals focus and I refocus on a different window it will steal focus again!! It does this several times during startup, it is VERY annoying!

0

I've noticed that since the apparent fix, the actual behavior is not ideal.

The problem is not that the startup idea grabs the focus, but that even if the user moved the focus to another window, the starting app would keep grabbing back the focus.

Now if I have other windows open and start idea, I wait for it to appear ... but no, where is it?

It's behind the other windows, which doesn't make sense.

Please initially have the focus on the starting app and allow the use to click elsewhere...

0

Guys, please comment in YouTrack so that developers can see your feedback. They do not monitor this forum.

See https://youtrack.jetbrains.com/issue/IDEA-106716 and the linked issues.

0

Please sign in to leave a comment.