keyboard focus
已回答
We still receive a few requests that claim that the keyboard focus
sometimes gets lost under some conditions. Since IDEA is a very
keyboard-intense application this is very important and needs to be
fixed before the release.
If you experience such things, please write directly to this thread on
what you do before the focus gets lost. Please don't forget to mention
your OS and Java versions as well as an IDEA build number.
Thanks.
--
Kirill Kalishev
JetBrains, Inc.
http://jetbrains.com
"Develop with pleasure!"
请先登录再写评论。
A very annonying keyboard focus problem I've just encountered is when using the Project 'Favorites' view.
When the 'Autoscroll from Source' icon is selected in Project toolbar and the 'Favorites' view is active, whenever an editor tab is selected for a file that exists in the Favorites view, the file is selected and highlighted in the Favorites view tree, but focus does not return to the editor.
As a result of this, I continually find myself typing into the Favorites panel instead of the selected editor.
This problem only manifests for the Favorites view. Other project views seem OK.
OS: Mac 10.10.5
PyCharm 2016.2
Build #PY-162.1237.1, built on July 20, 2016
JRE: 1.8.0_76-release-b216 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
When I command+tab away and then back, my cursor disappears and I can't figure out how to get it back with anything other than clicking the mouse. I am using the IdeaVIM plugin.
Pretty much every time I run Idea build7361 (7.0release) on Ubuntu Linux 7.04 (kernel 2.6.20), IDEA stops responding to the keyboard at some point. I can switch out to a terminal and type fine, but in IDEA there is no response to the keyboard. There is no consistency to what I'm doing before it stops responding except that it will happen within 20 min (or often less). It will even if I launch IDEA and it is sitting in the background and then I switch to it.
When you say loses keyboard focus, is that what you mean?
On 2007-10-19 11:20:28 +0400, Andy Kriger <no_reply@jetbrains.com> said:
Not exactly, I meant a case, for instance, when you press Alt-Ins,
select New Class, type in a name, press Enter and keyboard focus is not
in the editor for the new class.
Anyway, what you say is definitely a problem, thanks for reporting
this. If you could also take a thread dump as IDEA get unresponsive,
that would help a lot.
--
Kirill Kalishev
JetBrains, Inc.
http://jetbrains.com
"Develop with pleasure!"
Well, it happens to me from time to time.
Usually I navigate to other class nearby with Alt+F1/Project -> change class.. -> F4
I use WinXP 64bit, java 5 or 6 - does not matter..
This is happening with alarming frequency to me as well: Ubuntu 7.10, Idea Build 6189.
How do I get a thread dump when this happens?
-Matt
Well, I just figured out what was causing my problems in Ubuntu. When using Compiz Fusion, I was having periodic issues where windows or dialogs would comp up and and just be empty frames. Research revealed that one fix to this was to set:
AWT_TOOLKIT="MToolkit"
in your environment. Unfortunately, this didn't actually fix the issue, and without my realizing it, it appeared to be the source of my focus problems as well. Since removing it, I haven't had any issues with focus. I'm still having problems with empty dialogs and windows, but I've temporarily resolved that by not using Compiz Fusion.
Well, this might not exactly what you meant, but it's something I recently noticed:
If you do a search on your whole project for a certain string, you can navigate to the found results using CTRLALTUP/DOWN. This is great, and I only recently noticed this. I wanted to use it for a search and replace, but I couldn't use the normal search and replace (actually, I wanted to change something like: user.setName(String) to user.setName(new Name(String)). I don't know if there's an easy refactoring for that, and maybe you can use Structural Search and Replace, but that's to hard for me, so I wanted to do it manually.
Anyway, what happened was that I searched, changed the lines of code, pressed CTRLALTDOWN, and nothing happened! The search result window was still open, the results were there, when hovering over the 'next result' button you could see the same shortcut, but it didn't work, because the window wasn't focused! So I had to click on the result, press CTRLALTDOWN then, change the code, click on the window again, etc...
I like IntelliJ for it's keyboard navigation, but things like this could be improved, I think! Would be a nice feature if it worked, anyway.
I have this issue and I had filed http://www.jetbrains.net/jira/browse/IDEA-15911
before finding this thread.
I'm using AWT_TOOLKIT="MToolkit" on Ubuntu 7.10 with Compiz. Without this environment setting I was getting a problem with blank screens in IDEA and other Java Apps. This worked fine with IDEA 6.0.5 for me. With IDEA 7 I have frequent loss of keyboard input to the extent it is not really even usable.
I would appreciate any suggestions that make this work without me giving up the desktop environment.
My testing has been bad somehow because I went back to IDEA 6.0.5 still with Ubuntu 7.10 and was facing similar focus problems. So I decided then to try Matthew Welch's suggestion and I stopped using AWT_TOOLKIT="MToolkit" and came back to IDEA 7.0. The keyboard focus problem is gone or at least much more rare now; the blank window problem does happen but not very often. So I'm working tolerably well now with 7.0 and Ubuntu 7.10 with Compiz Fusion.
Message was edited by:
Anil Gangolli
Fixed mistaken ref to IDEA 7.0.5
same Problem here :(
is there an Update do IntelliJ 7.0.5 somwhere? (maybe Beta)
I found just one place, where focus constantly disappears (I work on Mac OS X Leopard, Selena 7584).
1. Undock project tool window, close it (click to editor).
2. Command+1 to go to project window.
3. Double click on any of classes.
Cursor is not there.
On the contrary, if window is docked , double click works correctly and cursor appears where it has to be.
Hope it helps. Cause the bug is still here through all the last betas.
This problem happens for me as well in IDEA 7.0.2, windows XP. This particular error only occurs if I double click on a file that is not already open in one of the tabs.
I don't normally open files with the mouse this way, but I do do it when it comes time to clone an existing class. This sequence of events will also lead to no keyboard focus.
1. alt-1 to bring up project window
2. right click on source class, select copy
3. right click on destination package, select paste.
4. press enter several times to create a new class, add to cvs.
The result is the new class is focused in the editor and the yellow line of the editor has a line selected. The keyboard can even be used to move this line up and down, but there is no insertion point displayed. You can even use the keyboard to navigate to the end of the selected line. If the last character of the line is an opening brace for example, IDEA will even show the code block lines in the gutter. But, you can't type any new text with the keyboard. You can only navigate in the dark. You can see what line is selected, but not where in the line. Pressing ESC does nothing. You need to click the mouse in the editor pane for a insertion point to show up.
This is not the only condition that causes this result. There are other occasions when this happens, but many times it is not reproducible.
On Windows Vista, running build #7648 (not new in 7648 -- it's been this way for quite a while).
1. Open a source file
2. Bring up the structure view using alt-7 (I have it pinned on the left side)
3. Hit escape to put focus back into the source window
4. hit alt-w-a to close all editor windows
Now, there are no editor windows open, and you should notice that the structure window/pane is not active (it's title bar is not highlighted).
At this point, no alt- menu shortcuts work -- alt-f doesn't bring up the file menu, alt-w doesn't bring up the window menu, etc. ctrl- shortcuts (ctrl-n, ctrl-e, etc.) still work.
alt-7 will re-activate the structure pane at which point the alt- menu shortcuts will work again.
anders
IntelliJ IDEA 7.0.2 build #7590
Jdk : 1.6.0_10-ea-b11
OS: Open Suse 32 bit 10.3 Kernel: 2.6.22.17-0.1
compiz /fusion are disabled under gnome
ctrl-alt-l to format code/xml, if enter key will not close the pop-up dialog, the focus is gone. This happens quite frequently, almost 40%-60% of the time.
After enable compiz/fusion, same thing happened, just more frequently
quite annoying.
I have this problem... even in Idea 8
I run IDEA on a pc at work and on my laptop. Both are fedora core 6. Both are Dell machines.
The problem only occurs on the desktop. And the only major difference is that it's a 64 bit architecture.
The problem can occur at any time as a result of jumping into a dialog. One observation is that it definitely happens a whole lot more when I do a lot of debugging. On a day without debugging it might happen once or twice. On a day where I am debugging it will happen at least once/hour if not more!
An other interesting thing is that not all key-board actions are lost when this happen. holding down the control/shift/alt key can still be used to change what will happen when I click with the mouse.
regards,
Florian Hehlen
I am running Intellij IDEA 8.1, build #9164 on RHEL 5.0 64bit. I use gnome as my desktop. My jvm is sun jse 1.6.0_06.
9 our of 10 times, when I switch out of intellij application to another app using mouse click, or alt-tab, and switch back, I find intellij loses keyboard focus. There was no easy way for me to get the editing pane to accept my keyboard input. For now one way that works for me is to double click a class/filename in the project navigation pane, which has the side effect of moving the cursor to the beginning of the class. This has been very annoying to me.
I've started to encounter this bug in the latest IDEA 8.1 builds (currently running idea-9757) on my home desktop machine (Ubuntu 8.10 64-bit). I've tried both 1.6.0_10 and 1.7.0_b50 as my JVM and it occurs on both. I've been using various IDEA EAP builds over the past year on this same system, and this bug only started appearing since 8.1.
Loss of keyboard focus seems to occur quite randomly - I'll go for a few hours without having any problems, then I'll hit a spot where it loses focus 5 minutes into launching. I haven't been able to find any tricks to get it to restore focus, which means a full restart of IntelliJ every time it happens (making the product quite unusable).
I'll try to post updates if I discover anything more particular over the next few weeks. I'd be glad to post stacktraces or debugging logs if it might be helpful. If this bug persists in future releases of IntelliJ, I won't be able to use it any longer.
I have this problem on ubuntu 8.0.4 x64. This occurs in idea 8.1.2 and idea 10313 with jdk 1.6.0_13 x32.
I have to restart the X-server and eventually reboot.
Same problem here on Ubuntu 9.04 64-Bit using a 64-Bit 1.6 JDK
The error occurs in both 8.1.2 and Maia EAP 10313. Please look into this ASAP - right now, IDEA is unusable for me :-(
That is good news - I hope a new EAP is coming soon :-)
I'm afraid the problem is still there, at least in Build 10781.
Right now, I still see three different problem areas:
1. Using multiple project windows
I have a lot of problems with the keyboard focus being set on the wrong window when working with several projects open at the same time.
For example I switch to the other project window using the Alt+Tab shortcut of the operating system. When I hit Ctrl + N in order to navigate to a file, there seems to be no reaction. However, when I switch back to the first project window, the "Enter class name"-Dialog is showm there - so the Ctrl + N shortcut seems to be sent to the inactive project window.
2. No input is accepted
This problem is even more severe since it also occurs when working with a single project window. From time to time, IDEA stops to accept any input from the keyboard including shortcuts etc. I often have the problem that I'm unable to enter any text in the commit message dialog when I want to commit my changes to SVN. But I've also seen the main editor component stopping to accept any input.
Unfortunately, I cannot say what causes this error or how to reproduce it - it seems to occur randomly.
3. Wrong focus on the "Maven Projects" toolbar
This is not as severe as the other two problems but it annoys me from time to time: when I use the backspace key in one of the "go to"-dialogs (Go to file, go to class, go to symbol ...) the maven module that was last focused in the "Maven Projects"-Sidebar is removed without any confirmation question. Instead IDEA asks me if I want to remove the module from the project as well. I always have to readd the maven module to the maven projects view and wait for IDEA to reindex that one. As I said: it is not that big of a problem and it does not happen always. But it is annoying and certainly not the way it is intended to be.
I really hope IntelliJ is still looking at these issues because right now, working with IDEA 9 is really frustrating and if these bugs persist, I'm actually considering not to upgrade upon release for the first time. I have never seen these problems with the 8.0 release but I haven't worked with the latest 8x Updates so I'm not sure if this error was introduced in the Maia builds only or also in the 8x builds.
My current configuration:
Ubuntu 9.04 64-Bit,
Sun Java (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
Is there any status update from IntelliJ on these issues ?
In Youtrack there are several bugs concerning these issues (http://youtrack.jetbrains.net/issue/IDEA-23472, http://youtrack.jetbrains.net/issue/RUBY-3665) that are still open and also concern the Rubymine-Application. So it seems to me that this is an issue related to the core IDEA platform.
Regards,
Christian
Christian,
I don't have all the problems you mentioned, but one possibly related problem I have on Maui 10781 on Ubuntu 9.04 64-bit with Sun jdk 6u18ea 64-bit, is that if I have ticked any window as "Always on top", then I start having wierd problems in IntelliJ, esp. with popup dialogs. The dialog will popup but when I try to type into it, it types into the Editor pane instead of the dialog.
If I make sure now window is ticked "Always on top", then I don't see any keyboard focus problem.
I do not open multiple project windows at the same time, so maybe that is why I don't see that problem.
Do you have your problems when you have no other windows running?
-Alex
Hi Alex,
thanks for your reply. I'm not sure what do you mean by "always on top" (do you mean "pinned" ?). My current tool-window configuration is this:
I have the "Project"-Toolwindow on the upper left side. This is the only toolwindow that is always open (it is docked and pinned).
On the lower left side I have the Structure, IDETalk and Web-Toolwindows and on the upper right side I have the "Maven Projects" and "Ant Build" toolwindows - all of these are docked and pinned but usually closed. I only open these when I need them.
Finally, at the bottom I have the TODO and Changes toolwindows and the "Regex Tester" toolwindow from the equally named plugin. These are also docked and pinned but usually closed.
So to sum things up: I only have the Projects view open on the left and the editor in the middle. From time to time I have the Run/Debug views open at the bottom, but I cannot say for sure of these were always open, when the problems occurred.
However, I will follow your advice and start with all toolwindows closed and see if the problem occurs. If that is not the case, I'll try to nail the problems by testing the different tool windows one by one :-)
Christian
Christian,
I was referring to windows *outside* IDEA e.g. text editor, firefox, perforce p4v client, etc. In Ubuntu, if you access the window menu in the top-left corner, there is an option "Always On Top". If I enable that for a window *outside* IDEA, then I start having problems. Since you didn't know what I'm talking about, you probably aren't pinning windows like that. However, you might be running some other application which automatically puts itself on top, and that could cause the same problem.
-Alex
Thanks for the clarification - I wasn't thinking of windows outside of IDEA, that's why I wasn't sure what you meant.
I do have in fact an external IM window that is set to "always on top". I will give it a try, disable this setting and see if it helps.
Thanks again,
Christian
I frequently have a focus problem with CtrlN and CtrlF whih are
probably the shortcuts I use the most.
As I type Ctrl+F/N to input a searched string or class name, IDEA
frequently let me input the string in the editor file before showing
and setting the focus in the corresponding dialog. I end up with a lot
of corrupt files.
It's a speed problem, since the focus would come in the right place at
some point. But I think that once you've typed Ctlr+N/F, a dialog is
expected so IDEA shouldn't let the input go to the editor, and should
block it until the right dialog is ready.
I'm under OsX 10.6.1 with #9939. I don't know if it's really what you
meant by keyboard focus, but it's a keyboard focus problem for me!!
On 2007-10-05 20:06:16 +0900, Kirill Kalishev
<kirill.kalishev@jetbrains.com> said:
Just to give everyone interested a quick update:
The "always on top" does seem to have an impact. I haven't experienced the "total focus loss" since I disabled that option on my external instant messaging window.
However, I still have problems with the wrong project window being focused when I have multiple IDEA windows open.
And I also experienced the deletion of a Maven module when I was hitting the backspace key while typing in the "find/search bar" within the code editor.
Finally, in my opinion, IDEA 9 should also work with other windows being set to "always on top". Disabling this option might work as a workaround while using the EAP versions but I don't think this behaviour is acceptable in a final release.
Regards,
Christian