Crusade against focus stealing

Answered

Hereby, I convoke all IDEA users out there to gather together, and let our frustration be heard. It's a battle against the thieves, against applications this focus-stealing application that is IDEA today.

Numerous SCR have been opened, and numerous posts have been made in this forum. Now, what do we need to do to make JetBrains hear us, and remove every single line of code that make IDEA steal focus from other applications? Am I the only one who's utterly annoyed by this behaviour?

One may argue, but I can't think of one single reason to allow IDEA to steal focus. It's annoying, period. If I don't have IDEA focused, It's because I'm busy doing something else and I don't want to see IDEA window.

So, here I go again, almost losing my hopes... please, IDEA... don't take my focus away, it's all I have! Be merciful, I beg thee!

83 comments
Comment actions Permalink

Verily Sir! I doth agree with thine statement of fact! Woe is the application that steals thine eyes away from its labours. Repent not of your misfortune! I too rally to thy call! Behold! You have allies and thou shall not be unheard in your hour of need!

Together, and with others I trust, we shall impress upon those fine Sirs, JetBrainers, to remove all offending code for it does indeed warrant much abuse when activated!

A call to arms! Jetbrains! Harken our call.

-=david=-

0
Comment actions Permalink

I agree completely.

Point me to the SCR and I will vote for it.

0
Comment actions Permalink

#21628[/url], titled "IDEA steal focus constantly" is marked is fixed in build #978, yet this annoying behaviour is still present in #2128

#8181[/url] has recently been marked as "Problem", yet we still haven't heard why JetBrains can't fix it.

If you search the tracker or the forum you're bound to find many more related requests.

0
Comment actions Permalink

Yes, this is a VERY ANNOYING problem, which should be possible to solve
relatively easily.

Tom

0
Comment actions Permalink

Unfortunately, when reading the threads you cited it always comes
down to "sorry, it's Swing, not IDEA" and "Use TweakUI under
Windows to disable that behavior"

I'm utterly annoyed with it too, I feel your pain. I use TweakUI
to get rid of the problem for a few hours until some other misbehaved
application goes and changes the setting back..

Sad.

Vince.


0
Comment actions Permalink

Marcus Brito wrote:

So, here I go again, almost losing my hopes... please, IDEA... don't take my focus away, it's all I have! Be merciful, I beg thee!


I'll add a "me too" to this plea. Every day I trigger this bug multiple
times and it annoys me every single time. It's gotten so that I can't do
anything else that requires typing while IDEA is building or loading in
the project for fear of it stealing focus. That means I sit at my desk
staring at the monitor twiddling my thumbs while IDEA does its thing.

I know that JetBrains is aware of this problem
(http://www.intellij.net/tracker/idea/viewSCR?publicId=8181), I'm just
making sure that they are aware of how annoying it is to their users 8)

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

0
Comment actions Permalink

Vincent Mallet wrote:

Unfortunately, when reading the threads you cited it always comes
down to "sorry, it's Swing, not IDEA" and "Use TweakUI under
Windows to disable that behavior"


Of course it is AWT/Swing, but one can work around it relatively easily.

I'm utterly annoyed with it too, I feel your pain. I use TweakUI
to get rid of the problem for a few hours until some other misbehaved
application goes and changes the setting back..


... like FinePrint 2000 or FindPrint pdfFactory.

Tom

0
Comment actions Permalink

Interesting. I haven't seen this behavior under OS X. Though, perhaps related, IDEA is contantly trying to get my attention by "bouncing in the dock" when it pops up a dialog. If IDEA is grabbing focus on your platform under the same circumstances that cause my dock to bounce, you have my sympathy. It's annoying enough when that happens and it's just cosmetic.

0
Comment actions Permalink

I too find it very annoying. It’s definitely a candidate for inclusion in the sequel to GUI Bloopers. I have participated in the above mentioned threads and have looked into the source code for the Java API to see for my self if it really is AWT/Swing.

Sure enough, there are a few toFront() calls sprinkled around in API methods that are typically called directly or indirectly to update a panel. This is probably the explanation behind the behavior.

But as have been suggested by many eager participants in this discussion, there are several easy workarounds to turn to in order to fix this without rewriting IDEA from scratch.

One of them – as posted also in this thread – is to postpone updating panels until IDEA is brought to the front by the user.

Lately, the JDIC initiative has finally brought us a portable API for accessing the tray area of the desktop. I would suggest that JetBrains consider redesigning the user interaction to use this TrayAPI to place an icon in the desktop tray area and use it for signaling process completion information to the user.

Right now I guess JetBrains are working furiously to finish 4.5, and sounding like a broken record I repeat my plea that when it’s done, please take a pause from chasing new functionality and work through the large number of open issues – including this focus problem.

Best regards,
Lars Ugleberg

0
Comment actions Permalink


If I put the IntelliJ window in the background while it is starting up or doing a compile using Ant window, when it is done, it brings the IntelliJ window to the front.

I find this behavior really annoying. This shouldn't be the default behavior.

Also, at startup, the progress bar / productiviy tips window needs a "Minimize..." button so I can minimize IDEA. Currently I have to use ALT-TAB to select another application window or select the other application from the taskbar.

0
Comment actions Permalink

This is not a problem on OS X (Thanks for doing one of those things right
Apple). We do get the bouncing icon, which is fine by me. This problem is
99% of the time exhibited on Windows... Haven't really seen this on Linux.

R


On 6/21/04 10:34 PM, in article
4229341.1087871671042.JavaMail.itn@is.intellij.net, "Mike T. Miller"
<no_mail@jetbrains.com> wrote:

Interesting. I haven't seen this behavior under OS X. Though, perhaps
related, IDEA is contantly trying to get my attention by "bouncing in the
dock" when it pops up a dialog. If IDEA is grabbing focus on your platform
under the same circumstances that cause my dock to bounce, you have my
sympathy. It's annoying enough when that happens and it's just cosmetic.


0
Comment actions Permalink

Alex wrote:

If I put the IntelliJ window in the background while it is starting up or doing a compile using Ant window, when it is done, it brings the IntelliJ window to the front.

I find this behavior really annoying. This shouldn't be the default behavior.


Even more, it comes up even when the ant build itself is done in the
background (no modal dialog).

Also, at startup, the progress bar / productiviy tips window needs a "Minimize..." button so I can minimize IDEA. Currently I have to use ALT-TAB to select another application window or select the other application from the taskbar.


I use the Win+D combination (assuming that you have windows key on your
keyboard.)


-- dimiter

0
Comment actions Permalink

The boucing dock icon is not the worst of it. If you are a keyboard shortcut junkie like myself, then you will get constantly plagued by focus stealing.

Minimizing the IDEA window, and use a keyboard shortcut, Command + Q for instance, in any other app and IDEA flies open again stealing focus. Even more annoying is that it hasn't really signaled the maximize either, it's still minimized in the Dock. Trying to minimize while in this state does nothing. You have to actually click in the Dock to maximize it again and then you can minimize it once more.

0
Comment actions Permalink

I did notice this actually. Minimize IDEA, then if it maximizes itself,
it's really not maximized, it's disabled, and to get it enabled you have to
click in the doc at which point it will minimize and re-maximize. Weird...
perhaps it's a side effect of what people see on windows?

Also this is still not an issue for me as I use multiple desktops and idea
is always maximized on some other desktop out of the way, and I got back to
it when I need to, and I let the icon do the jumping jack flash all it
wants.

Still, it is a bigger issue on windows, and since I do use windows
sometimes, it's a pain in the ass... Plain and simple.

R


On 6/22/04 2:05 PM, in article
19544389.1087927532257.JavaMail.itn@is.intellij.net, "Alex Arnell"
<no_mail@jetbrains.com> wrote:

The boucing dock icon is not the worst of it. If you are a keyboard shortcut
junkie like myself, then you will get constantly plagued by focus stealing.

Minimizing the IDEA window, and use a keyboard shortcut, Command + Q for
instance, in any other app and IDEA flies open again stealing focus. Even
more annoying is that it hasn't really signaled the maximize either, it's
still minimized in the Dock. Trying to minimize while in this state does
nothing. You have to actually click in the Dock to maximize it again and then
you can minimize it once more.


0
Comment actions Permalink

I'm also a keyboard junkie, but my usage patterns are different: I don't seem to have this focus stealing problem.

I use LaunchBar extensively, I never minimize things to the dock, I use 'command-tab' and 'command-`' all the time. I just wish certain dialogs weren't modal (related to the 'tip-of-day' thread) so that Idea wasn't constantly trying to get my attention (loading projects, after a build, etc.).

0
Comment actions Permalink

yep, this is my number one complaint with IDEA. Apart from that it is perfect :)
I put in a bug report about a year ago about this. And all I have heard from IntelliJ is that this is a "Swing bug" or that it is "not an issue".
It happens on Linux as well as Windows. Bloody annoying.

0
Comment actions Permalink

It is annoying beyond belief; especially when IDEA updates its cache after an ANT rebuild. After it has finished processing each of the 200+ files, it steals the focus, which ties the machine up for about two minutes.

Yes. Fix it for God's sake!

And while I'm here, I'd also like them to come up with a way to show all the matched classes/symbols/files/whatever in the Goto... window!

0
Comment actions Permalink

Issues for this are opened since Ariadna, and all we hear is "sorry, we
know this is important, but won't make in into Ariadna.
Are we hearing "sorry, not for Pallada" now?

--
Marcus Brito <pazu@animegaiden.com.br>


0
Comment actions Permalink

Marcus Brito wrote:

Hereby, I convoke all IDEA users out there to gather together, and let our frustration be heard. It's a battle against the thieves, against applications this focus-stealing application that is IDEA today.

Numerous SCR have been opened, and numerous posts have been made in this forum. Now, what do we need to do to make JetBrains hear us, and remove every single line of code that make IDEA steal focus from other applications? Am I the only one who's utterly annoyed by this behaviour?

One may argue, but I can't think of one single reason to allow IDEA to steal focus. It's annoying, period. If I don't have IDEA focused, It's because I'm busy doing something else and I don't want to see IDEA window.

So, here I go again, almost losing my hopes... please, IDEA... don't take my focus away, it's all I have! Be merciful, I beg thee!



Let me desribe the problem. I often hear that there is a simple work
around but I've never seen this work around.

IDEA uses modal dialog. To close dialog we use Dialog.dispose() method.
Here is a native implementation of "dispose" method

(file awt_Dialog.cpp line 477)
MsgRouting AwtDialog::WmEndModal()
{
DASSERT( ::GetCurrentThreadId() == AwtToolkit::MainThread() );
DASSERT( ::IsWindowVisible( GetHWnd() ) );
DASSERT( ::IsWindow(m_modalWnd) );

// re-enable top-level windows
AwtDialog::ModalEnable( GetHWnd() );

HWND hWndParent = ::GetParent( GetHWnd() );
BOOL isEnabled = ::IsWindowEnabled(hWndParent);

// Need to temporarily enable the dialog's owner window.
// If we don't enable the owner, Windows will activate
// the last active top-level window, which could be
// another application entirely (the dreaded bug 4065506).
::EnableWindow(hWndParent, TRUE);
// hide the dialog
SendMessage(WM_AWT_COMPONENT_HIDE);
// restore the owner's true enabled state
::EnableWindow(hWndParent, isEnabled);

// bring the next window in the stack to the front
//!!!!!!!!!!!!!!!!!!!!!!!!!
AwtDialog::ModalNextWindowToFront( hWndParent );
//!!!!!!!!!!!!!!!!!!!!!!!!!
m_modalWnd = NULL;

return mrConsume;
}

I've marked by '!!!!!!' the native code that brings parent window to
front. If you know how to prevent moving parent window to front please
post your workaroung here or drop e-mail to me (vova@intellij.com)


--
Vladimir Kondratyev
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

If hiding (without disposing) a dialog does not have this behavior we could
dispose them later, let's say when the main frame gets active.

Eugene


"Vladimir Kondratyev (JetBrains)" <vova@intellij.com> wrote in message
news:cbbs8t$ur9$1@is.intellij.net...

Marcus Brito wrote:

Hereby, I convoke all IDEA users out there to gather together, and let

our frustration be heard. It's a battle against the thieves, against
applications this focus-stealing application that is IDEA today.

>

Numerous SCR have been opened, and numerous posts have been made in this

forum. Now, what do we need to do to make JetBrains hear us, and remove
every single line of code that make IDEA steal focus from other
applications? Am I the only one who's utterly annoyed by this behaviour?

>

One may argue, but I can't think of one single reason to allow IDEA to

steal focus. It's annoying, period. If I don't have IDEA focused, It's
because I'm busy doing something else and I don't want to see IDEA window.

>

So, here I go again, almost losing my hopes... please, IDEA... don't

take my focus away, it's all I have! Be merciful, I beg thee!
>
>

Let me desribe the problem. I often hear that there is a simple work
around but I've never seen this work around.

>

IDEA uses modal dialog. To close dialog we use Dialog.dispose() method.
Here is a native implementation of "dispose" method

>

(file awt_Dialog.cpp line 477)
MsgRouting AwtDialog::WmEndModal()
{
DASSERT( ::GetCurrentThreadId() == AwtToolkit::MainThread() );
DASSERT( ::IsWindowVisible( GetHWnd() ) );
DASSERT( ::IsWindow(m_modalWnd) );

>

// re-enable top-level windows
AwtDialog::ModalEnable( GetHWnd() );

>

HWND hWndParent = ::GetParent( GetHWnd() );
BOOL isEnabled = ::IsWindowEnabled(hWndParent);

>

// Need to temporarily enable the dialog's owner window.
// If we don't enable the owner, Windows will activate
// the last active top-level window, which could be
// another application entirely (the dreaded bug 4065506).
::EnableWindow(hWndParent, TRUE);
// hide the dialog
SendMessage(WM_AWT_COMPONENT_HIDE);
// restore the owner's true enabled state
::EnableWindow(hWndParent, isEnabled);

>

// bring the next window in the stack to the front
//!!!!!!!!!!!!!!!!!!!!!!!!!
AwtDialog::ModalNextWindowToFront( hWndParent );
//!!!!!!!!!!!!!!!!!!!!!!!!!
m_modalWnd = NULL;

>

return mrConsume;
}

>

I've marked by '!!!!!!' the native code that brings parent window to
front. If you know how to prevent moving parent window to front please
post your workaroung here or drop e-mail to me (vova@intellij.com)

>
>

--
Vladimir Kondratyev
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"



0
Comment actions Permalink

The solution is to watch for window deactivation. If the window gots
deactivated (e.g. switched to another application), you MUST not close
the dialog until the user switched back to IDEA.

BTW, this was discussed a long time ago.

Tom

0
Comment actions Permalink

Thomas Singer (MoTJ) wrote:

The solution is to watch for window deactivation. If the window gots
deactivated (e.g. switched to another application), you MUST not close
the dialog until the user switched back to IDEA.

BTW, this was discussed a long time ago.

Tom


Well, that will lead to IDEA stops performing its tasks when one of them is completed.
For example, compiling shows two modal dialogs subsequently if you have an Ant task assigned to be run prior make. So if
you start make procedure and switch the focus away immediately (which is quite expected user behaviour) you'll get idea
stuck after ant task is done and will not go to a compilation stuff since modal dialog blocks workflow execution.

So, wouldn't that be better to apply your enormous lobbying energy to a responsible Sun engineers instead of blaming JB
developers for the bugs they didn't introduce and (probably?) can only workaround with a deep Swing hacking?

Why don't you also blame the vendors who's applications tweak registry values making other applications to steal focus
instead of just flashing an icon in the taskbar?

--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Well, that will lead to IDEA stops performing its tasks when one of them
is completed.
For example, compiling shows two modal dialogs subsequently if you have
an Ant task assigned to be run prior make. So if you start make
procedure and switch the focus away immediately (which is quite expected
user behaviour) you'll get idea stuck after ant task is done and will
not go to a compilation stuff since modal dialog blocks workflow execution.


You are showing two dialogs one after another? This does not look to be
good design, from my outside point of view. I could remember IDEA
showing a couple of progress dialogs, which "easily" can be merged into
one progress dialog. Nothing, that could not be solved by better design.

Cheers,
Tom

0
Comment actions Permalink

>> Well, that will lead to IDEA stops performing its tasks when one of them is completed.
For example, compiling shows two modal dialogs subsequently if you have an Ant task assigned to be run prior make. So if
you start make procedure and switch the focus away immediately (which is quite expected user behaviour) you'll get idea
stuck after ant task is done and will not go to a compilation stuff since modal dialog blocks workflow execution. <<

The other side of this arguement is that when IDEA is doing several processes one after the other in quick succession (like rebuilding the cache), the whole PC is locked up until its finished. It shows a new dialog once every two seconds or so, which means the machine cannot be used.

>> So, wouldn't that be better to apply your enormous lobbying energy to a responsible Sun engineers instead of blaming JB developers for the bugs they didn't introduce and (probably?) can only workaround with a deep Swing hacking? <<

... or you could get rid of those 'working' dialog boxes althogether and just open up a fancy console window in the botton half of IDEA, and show progress in that. It could close itself when its done.

0
Comment actions Permalink

Maxim Shafirov (JetBrains) wrote:

Thomas Singer (MoTJ) wrote:

>> The solution is to watch for window deactivation. If the window gots
>> deactivated (e.g. switched to another application), you MUST not close
>> the dialog until the user switched back to IDEA.
>>
>> BTW, this was discussed a long time ago.
>>
>> Tom


Well, that will lead to IDEA stops performing its tasks when one of them
is completed.
For example, compiling shows two modal dialogs subsequently if you have
an Ant task assigned to be run prior make. So if you start make
procedure and switch the focus away immediately (which is quite expected
user behaviour) you'll get idea stuck after ant task is done and will
not go to a compilation stuff since modal dialog blocks workflow execution.

So, wouldn't that be better to apply your enormous lobbying energy to a
responsible Sun engineers instead of blaming JB developers for the bugs
they didn't introduce and (probably?) can only workaround with a deep
Swing hacking?

Why don't you also blame the vendors who's applications tweak registry
values making other applications to steal focus instead of just flashing
an icon in the taskbar?

The 'real' solution would be for Sun to fix the problem, but that ain't
going to happen anytime soon. Certainly not for Tiger. In the mean time,
it annoys a lot of people and turns them off of IDEA.
So, the really real solution would be to work around Sun's bug. One way
to do this would be to separate the processes from the dialogs, so that
it isn't required for a dialog to close for the next process to start.
The dialog is only modal to the user interface, it doesn't stop other
threads from running. Since there's no 'user interface' when the user
switches away from IDEA, then you should be able to control the
processes without any regard for UI at all. MVC and all that. Not that
it won't be a major change, but it is certainly possible.

--
Rob Harwood
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

No, they are sometimes showing fifty or more, one after the other, depending on the size of your project.

0
Comment actions Permalink

So, wouldn't that be better to apply your enormous lobbying energy to a
responsible Sun engineers instead of blaming JB developers for the bugs
they didn't introduce and (probably?) can only workaround with a deep
Swing hacking?


Because you can't convince SUN to fix this bug when they believe it's a RFE.

Why don't you also blame the vendors who's applications tweak registry
values making other applications to steal focus instead of just flashing
an icon in the taskbar?


I've also blamed FinePrint vendors, but they did not fix the bug - they
said, this feature is necessary to popup the FinePrint window...

Friendly,
Tom

0
Comment actions Permalink

On 23-06-2004 17:23, Thomas Singer (MoTJ) wrote:

I've also blamed FinePrint vendors, but they did not fix the bug - they
said, this feature is necessary to popup the FinePrint window...


They probably want to push you into upgrading:-) I use FinePrint 5 and
don't have problems with it changing registry values so it can steal
focus (FinePrint 2000 is truly evil in that regard).

Bas

0
Comment actions Permalink

Well, we will take this as a compliment for a JB developers :)

--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Well, we will take this as a compliment for a JB developers :)


The question is, who is this JB developer :P

Tom

0

Post is closed for comments.