This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Newly created file does not have focus / cursor | ||
---|---|---|---|
Product: | editor | Reporter: | Jesse Glick <jglick> |
Component: | -- Other -- | Assignee: | issues@editor <issues> |
Status: | RESOLVED WORKSFORME | ||
Severity: | blocker | CC: | bht, dkonecny, issues, mmirilovic, mslama, pzavadsky |
Priority: | P4 | Keywords: | A11Y, FOCUS, RANDOM, THREAD |
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
One log (redundant lines counted: "... | uniq -c"). Had a bunch of files open, restarted w/ flag. Caret blinking in some ed window. Pressed Alt-Left. Tab switched correctly, but no caret (until I switch focus elsewhere & back).
Different scenario. IDEListenerHook.java already open in editor. In Explorer, click IDEListener.java (a tiny file). [log begins] Press Enter. IDEListener tab opens, but no caret. [log ends] |
Description
Jesse Glick
2003-02-14 21:06:04 UTC
I cannot reproduce it on [nb_dev](20030217), [jdk1.4.2](b16) I am sorry, I have Solaris , CDE I cannot reproduce it on [nb_dev] 200302170100, Linux RH 7.2, GNome JDK 1.4.1. On Win2000 in today's dev build this seems to be OK for me. What does not work for me is creating of file by keyboard: CTRL+N shows the New Wizard, arrows choose template, but there is no way to press Next button - Enter does not work and Tab completely lost focus. I cannot reproduce in *consistently* in today's build. But it happens *sometimes* if you create enough files. I am pretty sure there is a race condition because it seems to happen most reliably for files which are small (quick to load?) when opened, e.g. new empty text files often do it, whereas bigger Java sources don't always. Large existing sources never do it. XML files never do it (my guess: trying to load grammar, takes a slight bit longer). You have to turn off both the editor toolbar and the status bar to get it to happen - these apparently make the editor take a bit longer to come up, and will spoil the effect. "CTRL+N shows the New Wizard, arrows choose template, but there is no way to press Next button - Enter does not work and Tab completely lost focus" - that definitely does not happen to me; Enter advanced to the target chooser panel. The problem I mentioned is reproducible only on JDK 1.3 (in my case 1.3.1_06). On JDK 1.4 it works fine. I filed it as separate issue 31165. David, is there anything else beside the newly created issue? If not, please close this issue. Jesse's problem is stil valid. My one was filed as separate issue. I tried to reproduce as Jesse suggested with today dev build 200302210100, JDK 1.4.1_01, Linux, KDE 2.1.1 but no success. I disabled editor toolbar and created 10 java main classes using keyboard. Cursor is always at top left of newly pane and is visible. If you can still reproduce it I can prepare patch with logging where focus is going in your case. Is anyone else able to reproduce it? (Even on Win or Solaris?) You turned off the status bar too? It may be that it is only reproducible on certain CPU configurations, etc., according to speed and so on. I will try to run with a logging patch if you can make one. Easiest is to just commit to trunk but only enable conditionally using some ErrorManager prefix (use isLoggable). No. What status bar do you mean? IDE or just in editor? How to switch it off? I will try it again without status bar. Editor status bar. It can be turned off somewhere deep in the Expert tab of editor settings, I think. I guess the overhead in displaying line number, etc. is enough to make the bug unreproducible on my machine. But I always run with this bar disabled. Lowering priority since the bug seems to be rare except for people like me with small displays who disable various unnecessary GUI stuff. Yes now when I switched off status line it happens to me too. But focus seems to be at editor pane when I start to write cursor appears and I can write to editor. It just seems cursor is not visible from some reason. I reassign to editor to have a look. Agreed - what I observed of key typed events etc. are consistent with a hypothesis that the focus is technically in the editor pane where it should be but the editor is failing to display a cursor. *** Issue 31644 has been marked as a duplicate of this issue. *** If issue 31644 is in fact a duplicate of this then the description might need a change. What I have been seeing for months with all q-builds on different computers with speeds varying from 200MHz to 2GHz is very broad and not limited to new files or having the toolbar or status bar switched off. The only thing that makes it less likely to happen is when the target file is already open in another editor tab. This focus issue in SDI mode under JDK1.4 is so wide-spread across the system - it is not funny. I get it everywhere and it always reproduces: 1) when using Alt+G on a member e.g. method call that links to a different source file that is not already open in the editor 2) when clicking on links in the compiler output window 3) when clicking on links in the system output window 4) when clicking on a link in the debugger 5) when clicking on links in the search results What helps with case 1) sometimes is pressing Ctrl+3. It does not help a lot to turn the editor toolbar off. However when I turn the toolbar on, then focus is completely broken: Does not even work on Ctrl+K (return to the previous position) IMHO under JDK 1.4, the focus system is completely broken and it appears that fixes need to be applied to every singular little case. Otherwise I cannot explain that so many focus issues have been closed as fixed and I still cannot see a mayor improvement. One of those closed cases is issue 28416 which I can confirm that it works now, but it has only fixed the special case where open source files are swiched via clicking on the tabs in the editor window. No other focus improvement resulted from this fix. This is fundamental and I can't understand that it is given priority 4. Unfortunatelly, I cannot reproduce this problem. I commited additional debug messages to the trunk. They can be enabled via setting "netbeans.debug.editor.caret.focus.extra" property to true since tomorrow's build. For now there is "netbeans.debug.editor.caret.focus" property for simple detecting of gaining and losting the focus. If you can reproduce the problem, please attach a debug output. Bernard, if you think the issue #31644 is not duplicate, please reopen it. Also try to run ALT+G action with debug messages (with "...focus.extra"). It is very important to find out if the editor's BaseCaret really gains the focus. Also, please try to run additional focus lost cases you have reproduced and compare the debug message info for them. As for the priority, it is up to you: In accordance with http://qa.netbeans.org/processes/bug_priority_guidelines.html it should be P3 IMHO. Thanks, Mato Thanks Martin for the explanation. I will help pinning this down. It could be a rewarding exercise because I can reproduce this always. Where do I set the property netbeans.debug.editor.caret.focus.extra"? I haven't done anything like this before. Many thanks. You can set this property via command line parameter during starting IDE: runide -J-Dnetbeans.debug.editor.caret.focus.extra=true You should see the debug messages on the console and they should be written in your ide.log file also. I believe that whatever Bernard is reporting is probably a separate bug. (1) My bug occurs only haphazardly under certain conditions that appear to relate to the time required to open a file. (2) I use MDI only, he uses SDI. My bug is P4, not P3. Perhaps these should be filed separately, though the same debugging system property might be useful for diagnosing both. OK, I have reopened the issue #31644 Created attachment 9937 [details]
One log (redundant lines counted: "... | uniq -c"). Had a bunch of files open, restarted w/ flag. Caret blinking in some ed window. Pressed Alt-Left. Tab switched correctly, but no caret (until I switch focus elsewhere & back).
Created attachment 9938 [details]
Different scenario. IDEListenerHook.java already open in editor. In Explorer, click IDEListener.java (a tiny file). [log begins] Press Enter. IDEListener tab opens, but no caret. [log ends]
I can't reprocude it on latest build NetBeans 3.6 RC1, jdk1.4.2_03 on Linux RH9 KDE. Is anyone able to reproduce it ? Haven't seen it recently, I think. Sorry, I take that back - it just happened to me in a trunk build. Of course it is not reproducible. This continues to happen to me intermittently in trunk builds. Not reproducibly, and not very commonly, but sometimes. Has anybody experienced this problem in recent builds? I do not remember seeing this any time recently. I think it can be closed. Ok, anybody please reopen this if you spot it in dev build. Thanks. |