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.

Bug 97249 - Keyboard stops responding after CTRL+F with JDK 1.6
Summary: Keyboard stops responding after CTRL+F with JDK 1.6
Status: CLOSED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: David Simonek
URL:
Keywords: JDK_SPECIFIC
: 87467 94316 98071 101520 107120 (view as bug list)
Depends on: 60656
Blocks:
  Show dependency tree
 
Reported: 2007-03-06 03:51 UTC by _ markroth8
Modified: 2012-12-11 20:17 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
java log (21.86 KB, text/plain)
2007-11-28 11:11 UTC, David Simonek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ markroth8 2007-03-06 03:51:07 UTC
When running NetBeans 5.5 and JDK 1.6 on SuSE Linux 10.2, they keyboard stops
responding after pressing Ctrl+F and then Esc twice.  At first I thought it was
due to the Beryl window manager, but I've confirmed it happens using metacity,
or even twm.  Everything works fine with JDK 1.5.0_10.

The problem is also present with the current 6.0dev version of NetBeans.

The problem also happens when there are existing windows open when I start 
NetBeans.

Double-clicking a tab to maximize the tab reactivates the keyboard until I press
CTRL+F and Escape twice again.

To reproduce:
1. Load NetBeans
2. Open a .java file
3. Exit NetBeans
4. Load NetBeans again
5. Keyboard is frozen
6. Double-click file tab to maximize
7. Keyboard is unfrozen
8. Press CTRL+F and find 'abc'
9. Press Escape to close the Find dialog
10. Press Escape to clear the red status bar
11. Keyboard is frozen
12. Double-click file tab to restore.
13. Keyboard is unfrozen again.
Comment 1 Vitezslav Stejskal 2007-03-14 00:40:04 UTC
I am sorry, but I could not reproduce this behavior neither with 5.5 nor 6.0.
Are you sure that it's Netbeans and not something else interfering. I have FC5,
Gnome, JDK1.5.0_07 and JDK1.6.0-beta2.
Comment 2 _ markroth8 2007-03-14 01:11:44 UTC
I don't have the issues with any other application.  I'm using:

java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

SuSE 10.2, Linux 2.6.18.2-34-bigsmp #1 SMP

Using Beryl window manager, Gnome, nVidia GeForce 6800, TwinView

Same configuration works perfectly with JDK 1.5.0_10 but fails with JDK 1.6.0-b105.
Comment 3 Vitezslav Stejskal 2007-03-19 07:00:38 UTC
Hmm, something could be wrong with focus. Can you confirm that the focus is in
editor (ie. blinking cursor, editors tab colored)? Do you really have to
double-click the tab to fix the problem or would it be enough to just
single-click it (ie. place the focus in the editor pane)?
Comment 4 Vitezslav Stejskal 2007-03-20 03:53:54 UTC
The problem #2 reported in the issue #87467 looks similar to yours. Are you
setting the AWT_TOOLKIT environment variable?
Comment 5 Vitezslav Stejskal 2007-03-20 04:06:22 UTC
I've just googled this - http://wiki.beryl-project.org/wiki/Java. There seem to
be some issues with using Beryl in JDK6, which are likely to affect Netbeans as
well. Afterall Netbeans is just a swing application like any other. Also please
see the bugreport here - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509038.

I am sorry, but we might not be able to help you if this is a general Beryl vs
JDK6 issue.
Comment 6 Miloslav Metelka 2007-03-20 17:34:48 UTC
Closing as invalid since this is caused by the jdk issue with Beryl very likely.
If fixing of the jdk issue would not help to resolve this problem please reopen
this issue. Thanks.
Comment 7 _ markroth8 2007-03-21 01:59:50 UTC
Hi - sorry, I'd like to reopen this.

I initially figured this was a Beryl-related issue. However, if you read my
initial message closely, I've confirmed it happens using metacity,
or even twm window managers, so it doesn't appear to be specific to Beryl. I
also tried all the advice, even patching JDK 1.6.

I tried again today, and confirmed that the focus is in the editor.  Cursor is
blinking, and the editor tab is colored.  Single clicking a tab, alt+tabbing and
clicking in the window don't seem to make a difference.

I'm a developer and I'd be happy to try and debug this if you give me some
guidance. How can I help further diagnose the problem?
Comment 8 Miloslav Metelka 2007-03-21 17:24:36 UTC
OK, could you please edit netbeans.conf and add
-J-Dnetbeans.debug.editor.caret.focus=true
so that we know more regarding focus handling? Thanks.
Comment 9 _ markroth8 2007-03-22 02:27:56 UTC
Okay, I added -J-Dnetbeans.debug.editor.caret.focus=true and tried with Metacity
(note: not Beryl.  I did pkill beryl and loaded metacity instead).  I observed
tail-f messages.log on my second monitor:

1. Loaded NetBeans:
BaseCaret.focusGained(); doc=/files1/data/projects/scratch/src/scratch/Main.java
2. Tried typing.  It accepted my characters.  Nothing logged.
3. Pressed CTRL+F:
BaseCaret.focusLost(); doc=/files1/data/projects/scratch/src/scratch/Main.java
FOCUS GAINER:
javax.swing.plaf.metal.MetalComboBoxEditor$1[,0,0,247x23,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalComboBoxEditor$EditorBorder@5eae58,flags=8388904,maximumSize=,minimumSize=,preferredSize=,caretColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],disabledTextColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],columns=9,columnWidth=10,command=,horizontalAlignment=LEADING]
4. Pressed ESC:
BaseCaret.focusGained(); doc=/files1/data/projects/scratch/src/scratch/Main.java
5. Tried to type.  Nothing happened.  Cursor just blinks at me.  Nothing logged.
6. Double-clicked tab for Main.java.  It maximed and logged nothing.
7. Tried to type.  Accepted characters.
Comment 10 Miloslav Metelka 2007-03-26 16:31:35 UTC
Thanks, so it seems that the caret gets a regular focus event but the keystrokes
do not go to the editor pane. I have no idea what could be wrong but I doubt it
would be related to the editor.
Reassigning to core/winsys in a hope that they could advice some additional
logging that would help to identify the problem. Thanks.
Comment 11 _ markroth8 2007-04-20 03:51:21 UTC
This is just confirming that the problem still exists with JDK 1.6.0_01.
Comment 12 tommysven 2007-05-27 22:04:40 UTC
Hi, 

I just wanted to add that I'am seeing the same problem and I'm also using jdk
1.6.0. By following the reproduction stages in this thread I can consistently
reproduce the problem. I'm running Ubuntu Feisty Fawn 7.0.4 and Netbeans 5.5
Comment 13 _ markroth8 2007-07-25 03:49:30 UTC
Confirming this still exists with JDK 1.6.0_02.
I also want to report that steps 1-10 work fine for me with JDK 1.6.0 and JDK 1.6.0_01 now. I guess it is
project-dependent whether it is locked up as soon as I load NB. However, I can always reproduce this starting from step
8 (Ctrl+F) on any JDK 1.6.
Comment 14 _ markroth8 2007-07-25 04:37:26 UTC
Confirmed it also still exists with m10 of NetBeans 6
Comment 15 David Simonek 2007-08-06 15:25:44 UTC
It started to happen on my Ubuntu feisty 7.04 too...hm, there might be a problem deeper in Swing code, I will look at it
after I return from vacation.

Definitely P2, not being able to write in editor or do anything with keyboard is a serious error...
Comment 16 David Simonek 2007-08-17 13:50:42 UTC
*** Issue 101520 has been marked as a duplicate of this issue. ***
Comment 17 David Simonek 2007-08-29 13:03:08 UTC
Hello here,

After some evaluation and trying, I was able to reproduce the bug even with SwingSet2 demo in JDK. So it's JDK issue,
not directly NetBeans related.

I entered new JDK bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6598651 and wrote here all I know. I still
think that installation of Beryl WM is triggering the bug, even if WM is switched to Metacity later.

Closing as wontfix, will see what happens in http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6598651

markroth8, don't be afraid to wrote further observation or help JDK guys if you know why. We both can reproduce 100% so
we have the chance to chase it down :-)


Comment 18 olegsukhodolsky 2007-08-31 11:25:42 UTC
Hi,

I am an engineer who is responsible for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6598651.
It would be nice to recheck if the problem really reproducible with metacity (btw which version do you use?)
But it would be better to not kill Beryl, but start your session with metacity (to have clean environment).
Also, I wonder if the problem is reproducible with Compiz.

thanks in advance.
Comment 19 David Simonek 2007-08-31 14:58:06 UTC
Hi Oleg,

Yes, that's what I tried - start clean session with Metacity, selecting on login screen after machine reboot. But even
with that setup, error is 100% reproducible for me. But we tried on very similar configuration of my colleague and error
was not reproducible here, with only main difference between our setups that he didn't have Beryl installed in his
Ubuntu 7.04.

I will check with compiz on Monday when I'm near my Linux, but I guess error will be reproducible for me, as always :-)   
Comment 20 David Simonek 2007-09-03 13:42:15 UTC
*** Issue 94316 has been marked as a duplicate of this issue. ***
Comment 21 David Simonek 2007-09-10 16:27:04 UTC
*** Issue 98071 has been marked as a duplicate of this issue. ***
Comment 22 David Simonek 2007-09-14 13:43:45 UTC
*** Issue 107120 has been marked as a duplicate of this issue. ***
Comment 23 David Simonek 2007-09-14 13:51:57 UTC
Hi Oleg,

As you can see from a lot of duplicates, our customers are facing the problem quite frequently. If you could install
beryl , you'll be able to reproduce easily and you would have the chance to fix the problem. I actually think that beryl
WM just helps the error to appear always, but bug isn't only beryl specific.
Comment 24 olegsukhodolsky 2007-09-14 13:56:21 UTC
I will (try) to install the Beryl, though it is unclear for me how it can cause the problem if it is not executed.
Anyway will try to reproduce the problem.
Comment 25 olegsukhodolsky 2007-10-23 23:15:52 UTC
Good news (for NB) and bad news for me: I've installed Beryl and was able to reproduce the problem (w/o running Beryl 
itself).  Will investigate what is the cause of the problem.
Comment 26 David Simonek 2007-10-24 08:27:18 UTC
Thanks Oleg, I'm glad to hear this and hope that error won't be hard to fix.
Comment 27 olegsukhodolsky 2007-10-25 04:37:41 UTC
It looks like in my case the problem is caused not by Beryl, but by scim (input method engine).
As soon as I uninstall it I can not reproduce the problem :(

Can someone who can reproduce the problem run java with level for sun.awt.X11.kye logger set to FINEST and send me back 
(or attach to this issue).  I just want to check if the problem I see is the same as you have or not.

Thanks in advance
Comment 28 David Simonek 2007-10-25 09:06:11 UTC
Oleg, i tried to enable logging, but with no success. I think i would need more guidance...
I run netbeans with J-Dsun.awt.X11.kye.level=0 (as I learned from
http://bits.nbextras.org/dev/javadoc/org-openide-util/org/openide/util/doc-files/logging.html) but no logs on the console...

However, I find out that I can reproduce the error only on some JDK version, specifically:
JDK 1.5.0_12 - OK
JDK 1.6.0_02 - bug occurs
JDK 1.6.0_05 build 5 - OK
JDK 1.7.0 (build 1.7.0-ea-b11) - bug occurs.

Huh, strange...
Comment 29 olegsukhodolsky 2007-10-25 14:09:54 UTC
I usually use config file for this:
handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
.level= INFO
java.util.logging.FileHandler.pattern = java%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.level = FINEST
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

sun.awt.X11.kye.level = FINEST

------------
And than specify it using -Djava.util.logging.config.file=myfile
after this you should have output in console and java<digit>.log in the current directory (at least Ihope so ;)
Comment 30 David Simonek 2007-11-28 11:10:16 UTC
I finally managed to get some logs - but I was unable to get just sun.awt.X11.kye logs, it seems that no logger of name
"sun.awt.X11.kye" exists.

So I'm attaching log from all loggers, set global .level= FINEST

What I did:
- opened SwingSet2 demo
- move and click mouse into "Frame title" text field
- wrote "aaa" text
- press Alt+F, then arrow and enter to invoke About box
- finish About box with mouse click on OK button
- tried to write into "Frame title" again (nothing happened, bug is showing there)
- ended SwingSet2 by Alt + F4 press

all is under jdk 1.7.0, (build 1.7.0-ea-b11)
Comment 31 David Simonek 2007-11-28 11:11:14 UTC
Created attachment 53592 [details]
java log
Comment 32 David Simonek 2007-11-28 11:32:17 UTC
Uff, I found what is causing problems on my machine - phrebejk told me several days ago, but I didn't pay necessary
attention :-(

Problem is related to the line export AWT_TOOLKIT=MToolkit, which I added to my .bashrc in order to fix java problems
under Beryl, especially "blank windows" problem. After removing AWT_TOOLKIT=MToolkit, keyboard works OK for me and I
can't reproduce this issue. (yes I had to patch jdk to get rid of "blank windows" problem, but that's another story).

I read http://forums.java.net/jive/thread.jspa?messageID=246986&tstart=0 and it seems there are some more problems, but
i'm not sure I can help with reproduction of these...
Comment 33 olegsukhodolsky 2007-11-29 13:26:07 UTC
Ok, so now we know that this is a focus problem with MToolkit.  
I have update the AWt bug with this information.
Comment 34 Jiri Prox 2008-02-22 14:49:11 UTC
*** Issue 87467 has been marked as a duplicate of this issue. ***
Comment 35 Marian Mirilovic 2011-06-09 09:52:15 UTC
v/c
Comment 36 oraytman 2012-12-11 20:17:36 UTC
I just want to add that Float/Dock fix focus problem.

I'm on 

Linux chl-devworkl6 2.6.32-24-jump2.00 #1 SMP Fri Mar 11 08:33:22 CST 2011 x86_64 GNU/Linux

java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)


But I would like to know the "FIX", not the workaround.