History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-2359
Type: Bug Bug
Status: Reopened Reopened
Priority: Critical Critical
Assignee: Alexander Chernikov
Reporter: Stephen Scaringi
Votes: 34
Watchers: 34
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Can't type in editor using 5.0.1 and Linux

Created: 01 Sep 05 18:42   Updated: 06 Feb 08 21:07
Component/s: Code Analysis. Dependencies
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Text File FindUsagesLogs.txt (10 kb)

Environment: RHEL 3 with KDE 3.4
Issue Links:
Duplicate
 
This issue is duplicated by:
IDEA-4932 Text typed in the editor shows up in ... Resolved
IDEABKL-1908 Focus lost in linux Critical Resolved
IDEA-9306 Caret disappears when creating a new ... Closed
Relates
 
This issue is related to:
IDEADEV-12242 Linux: floating tool window keeps key... Major Closed

Build: 3,461
Severity: Extreme


 Description  « Hide
After upgrading to 5.0.1, the editor will frequently stop accepting text input – typing characters into a file. It looks like the editor still has focus, the cursor is blinking in the editor tab, but you can't type any text into the file. Other keyboard actions, cursor movement keys, ctrl-z, etc., still work.

I'm only seeing this on my linux box. 5.0.1 appears to work fine on my Windows machine.



 All   Comments   Work Log   Change History      Sort Order:
Keith Lea - 01 Sep 05 20:12
A coworker sees this too. In his case, all text input goes to another tool window, not the focused window.

Paulo Alexandre N. Traça - 01 Sep 05 23:25
I have seen this too. Whenever a change the editing tab or the IDEA window looses focus, when i return to the editor the text dosent appear. If a remove the focus from the idea window and then return it, the text appears.

I'm using linux FC3, jre 1.5.0 and kde 3.4


Thomas Hartwig - 01 Sep 05 23:41
For me the same problem since the new build #3461. I use KDE with focus follows mouse. If I focus to an other window and focus back the idea window the blindly typed keys appear in the editor.
Changing "idea.popup.weight" to medium does not help either.

Thomas Hartwig - 02 Sep 05 02:14
Perhaps this JDK related like some other bugs. What JDK are you using? I have upgraded to jdk1.5.0_04 now and will test it tomorrow.

Stephen Scaringi - 02 Sep 05 17:27
I was using jdk 1.5.0_02. I upgraded to 1.5.0_04, but that didn't help the problem.

Robert Hopwood - 11 Sep 05 19:13
I experienced the same symptoms. Build 3641, Redhat EL 3, JDK 1.5.0_02.
Focus in Tab A, switch to tab B, mouse click & type... characters went to Tab A. Also same behavior when using Find Find/Replace. After closing find dialog, when typing in Tab A characters still went to find dialog. I Swicthed to JDK 1.5.0_04. Now cannot reproduce.

Niklas Herder - 20 Oct 05 11:12
I'm using JDK 1.5.0_05, Gentoo Linux, and also have this problem.
It started with the 5.0 series.
Although I don't have a specific way to reproduce it. But it seems to happen when
focus is lost momentarily by the editor, for example when doing 'Layout code' via Ctrl-Alt-L.

Then the editor stops responding to keyboard events - although the mouse functions normally -,
and I have to restart IDEA to be able to type text again.


Thomas Hartwig - 04 Nov 05 18:16
The problem did not occure any more at my work. Because it was hard to reproduce I can not say since when, but now I'm using build 3542 and did not have this problem for more than 2 weeks.

Niklas Herder - 10 Nov 05 13:30
I'm still having the same problem, with 3542, so the problem hasn't gone away.

Niklas Herder - 29 Nov 05 12:19
I get the feeling that the problem occurs more frequently when I'm attached to a remote debugging session via IDEA. Also, the remote debug never manages to detach from a session that's been terminated manually.
And has anyone tried running in some other DE (Gnome, for example)? It looks like a lot of us are running KDE 3.4. I never get this problem with other Swing apps, though.

Nadia Robertson - 29 Nov 05 12:31
I am running IntelliJ build 3542 under Gnome, and have the same problem.

Jeff Turner - 01 Dec 05 06:53
I've frequently had this problem editing JSPs (to the point I hardly bother trying any more, and switch immediately to vim), and occasionally with Java files, so file type/syntax may affect this.

Marcus Brito - 17 Dec 05 14:22
I've seen this too, long before 5.0.1 (long before 5.0, actually). My guess is that this is a VM/Swing problem.

ben tompkins - 18 Dec 05 06:06
I've experienced this problem as early as 4.x/rh9 and continue to do so on 5.02/rhas 3.
In my case, the blinking text cursor ALWAYS disappears and cannot be restored without
restarting Idea. Another key symptom I did not see mentioned at least explicitly in the
other postings on this bug is that left-clicking the mouse in the editor window is no longer
an effective means of restoring the cursor (and the keyboard focus) to the editor pane.
In other words, after moving the I-shaped mouse cursor to the position where I would
like to enter some text, I left-click. Normally, the I-cursor would immediately be replaced
by a blinking text cursor; however, as a result of the bug, the text cursor never appears
and text cannot be entered. I agree that the root cause lies with the keyboard focus,
and not with the text cursor, which is merely an indicator, but some some users
have said that the binking cursor is visible even though text cannot be entered and
my experience contradicts those reports. Perhaps these users have configured
their respective editors to use the text cursor as a mouse cursor, but this seems
unlikely (in fact I don't know whether it is even possible). Also, I have never experienced
behavior indicative of a SWITCH in focus, like text appearing in another tabbed pane.
On the contrary, there is always a total LOSS of the keyboard focus.

Lars Clausen - 19 Dec 05 13:22
I have this too under RedHat EL3, kernel 2.4.21, XFree86 v. 4.3, Metacity v. 2.4.55, IDEA build 3542. I suspect a window manager interaction issue.

Version 4.5 of IDEA had occasionally inability to regain focus after another window had had it, which got cured in the same way. It got much worse after changing to 5.0, now two switchings to other desktops are required, and input is still taken, but only inserted when the focus is regained - at whereever the cursor is then.

Never seen anything like it in other apps.


Stephen Scaringi - 19 Dec 05 18:00
I've upgraded to 5.0.2 and jdk 1.5.0_05, and this seems to have resolved the issue for me. I haven't seen the focus bug since the upgrade.

RHEL: 2.4.21-27.0.1ELsmp
KDE: 3.4.3-1.1.el3.kde


Lars Clausen - 20 Dec 05 12:22
Confirmed, that does indeed cure the problem. Wish I knew why

Konstantin - 03 Feb 06 21:55
It seems to be related to floated panels, when cursor has disappeared I 'unfloated' project panel where it seemed to stuck and then made it floating again. Cursor has appeared in the editor.

Seems like simpler solution than restarting


Niklas Herder - 07 Feb 06 17:05
I just downloaded IDEA 5.1, believing this issue to be resolved, but it isn't...
I still lose input focus from time to time. And the 'unfloat' trick doesn't always work for me.
So I vote for reopening this issue.
Using Ubuntu 5.10, Gnome 2.10, JDK 1.5.0_06.

Jeff Turner - 20 Feb 06 11:43
Same here using IDEA 5.1 + JDK 1.5.0_06. When the focus is lost (1-2 times a day) the switch-windows and unfloat tricks don't help, and I have to restart.

Luca Botti - 23 Feb 06 03:33
Add my comment here, Linux Gentoo, KDE 3.5.1, IDEA 5.1 + jdk 1.5.0_06. Suddenly, the cursor does not appear anymore. I can write, but without a cursor position.

Restarting does not help


Darryl Anderson - 24 Feb 06 00:35
Same problem here:
Gentoo Linux 2.6.12
JDK 1.5.0_06-b5
Idea 5.1 (build 4155)
Window manager: XFWM

I lose the input focus on average 10 times a day... makes using Idea nearly impossible. When it happens, the frame refuses to acknowledge any keyboard input, however it does respond to mouse input. I haven't found any way to get the frame to regain input focus by using the mouse. I have to kill the process and restart.

Seems to happen whenever Idea attempts to shift focus from a dialog box or popup back to the main frame. (For example, when I invoke Refactor:Copy, or press Alt-Enter on an inspection.)


Christoffer Hammarström - 09 Mar 06 18:33
Why is this issue marked as Resolved?

I'm still seeing this on Debian running kernel 2.6.15, using Gnome and Sawfish.
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_06-b05, mixed mode)

I have to restart IDEA every 5-10 minutes, and it's really annoying.


Christoffer Hammarström - 10 Mar 06 12:51
Could it be http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4851685 or any of the bugs related to it?

Per Leine - 20 Apr 06 15:11
I still experience the problem with 5.1.1(since 5.0), using KDE 3.3.2, i've tested on different platforms getting excatly the same problem. it often appears after fast typing/cursor movement: The blinking cursor disapperas when in the editing widnow, and no characters can be entered, but the "line marker" can be moved with the mouse (similar to opening a read-only file). The top menu can not be accessed using keyboard shortcuts, but can be opened with the mouse. If opening a dialog (e.g. search),

Renzo - 21 Apr 06 14:43
I`m using 5.1.1 and I experience the same problem (since 5.0):

suse 10.0 2.6.13-15.8-smp KDE 3.5.1 "level a"
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

The problem is really annoying, and actually with 5.1.1 seems to be even worst.


David M. Lloyd - 19 May 06 21:44
I also see this problem frequently... sometimes unfloating panes fixes it, sometimes not.

Anyone have any workaround at all for this?


Konstantin Sobolev - 05 Jun 06 04:22
I've tried 1.5.0_07 and 1.6.0-beta2-b84 together with idea-4247 and different WMs: fluxbox, kwin, sawfish, twm. Problem exists in all combinations, but in a less critical form: focus is gone almost always after some popup (like layout code or introduce variable dialog) is shown and then closed, but it can be restored by left-clicking the main window. It is still quite annoying and I've hacked up a sawfish script which forces focus return in such situations. Email me if you need it (konstantin[dot]sobolev[at]gmail[dot]com).

Christoffer Hammarström - 07 Jun 06 15:36
Focus losing is standard, and although annoying, something you can cope with.

The worse problem is that sometimes when focus is lost, you are unable to get focus back and type anything in the editor. You have to restart IDEA.


Jeff Turner - 08 Jun 06 04:45
> The worse problem is that sometimes when focus is lost, you are unable to get focus back and type anything in the editor. You have to restart IDEA.

Which JDK? In a JDK-specific bug, all "it breaks for me" comments that don't mention critical details like the JDK are next to useless.

FWIW, I used to have this problem. Upgrading to the latest JDK (1.5.0_06 at the time) fixed it.


Christoffer Hammarström - 08 Jun 06 12:32
> Which JDK? In a JDK-specific bug, all "it breaks for me" comments that don't mention critical details like the JDK are next to useless.

Thank you for your valuable input. Now if you scroll up to my comment dated march 9th, you'll find the details you need.


Kamil Podlešák - 08 Jun 06 12:54

The worse problem is that sometimes when focus is lost, you are unable to get focus back and type anything in the editor. You have to restart IDEA.

Which JDK? In a JDK-specific bug, all "it breaks for me" comments that don't mention critical details like the JDK are next to useless.

FWIW, I used to have this problem. Upgrading to the latest JDK (1.5.0_06 at the time) fixed it.

I had this problem with every JDK 1.5.0 I tried: 01, 02, 04, 06. No difference.


Christian Sarrasin - 08 Jun 06 15:31
I stumbled on this IDEA bug report courtesy of Google. I don't use IDEA but wanted to contribute something that may be useful in pointing to the root cause of the problem.

We have an inhouse trading application which exhibits exactly the same issue:

(1) keyboard input works fine,
(2) a popup appears,
(3) "keyboard focus" is lost; a text field appears to have focus (or the mouse can be used to give focus to any other text field) but you just can't type anything in.

Fortunately for us, dismissing the popup always cures the problem. The problem is intermitent (ie: won't occur every time a popup appears) - it's actually quite hard to reproduce in our testing environment.

Following configuration has the issue:
JDK 1.5.0_06, Red Hat Linux 2.6.9-22.0.1.ELsmp #1, Gnome/Metacity 2.8.6 - I have tried upgrading to 1.5.0_07 but not very hopeful given the list of fixed issues contained in it.

Following configuration does NOT have the issue:
JDK1.4.2_10, Windows XP Pro SP2

Conclusion: this really looks like a JDK 1.5 on Linux bug (not sure about 1.4 but not really an option for us) rather than an application specific one. Here are some more reports of this: www.jroller.com/page/slava?entry=java_1_5_window_focus... Yet Sun's bug DB doesn't really seem to contain anything that useful. We will raise this with our dedicated Sun support chanel.


Niklas Herder - 08 Jun 06 15:42
I've run IDEA with the 1.5.0_07 JDK, and the bug is still there.
IDEA 5.1.1, JDK 1.5.0_07, current Ubuntu (Dapper).

Keith Lea - 08 Jun 06 22:19
Yes, this happens to me on 5.0u6

sadik - 18 Jul 06 21:29
I have the same problem with all versions of IDEA 5.x on a RH system with JDK 1.5.0_02-b09. Symptoms are; when you navigate to another class you loose focus, and if you have more than one instances of IDEA running, your typings go to the other instance of IDEA. I'm also using JBuilder 2006 and Eclipse 3.2 on the same computer. I never met such a problem with Eclipse but same problem happened in JBuilder 2006 when I was trying to create new packages or classes using the small pop-up windows. JBuilder does not react to any keyboard input in these small pop-ups anymore. Why I'm writing this here is because, this kind of behaviour is common to both IDEs and it may be a Java bug not IDEA.

And i have two simple workarounds for the problem. For me, following two solutions work.

1. Minimizing and maximizing IDEA window makes the editor gain focus again. And voila, your typings are there. (But only if you have only one instance of IDEA running, otherwise your typings go to the other instance.)
2. Right-clicking on the editor window makes the editor gain focus again. (But sometimes, if you have some copied text in clipboard they will be pasted to the location where you just right-clicked.)


Christian Sarrasin - 18 Jul 06 21:51

Why I'm writing this here is because, this kind of behaviour is common to both IDEs and it may be a Java bug not IDEA.

This is consistent with my previous comment. I'd say it's a Swing bug rather than Java. Eclipse uses SWT...


Konstantin Sobolev - 02 Sep 06 23:49
I've stumbled upon the "light version" of this bug again when I decided to switch away from sawfish to ion3 WM.
By "light version" I mean a focus loosing (caret disappearing) problem which can be cured by left-clicking editor region. On sawfish I made a workaround mentioned in my previous post, but on ion3 similar hack doesn't work (WRegion.goto(ioncore.current() doesn't fully restore IDEA focus).

I made some investigation and here's what I have found: IDEA's XWindow uses Globally Active ICCCM focus model (see http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7 ): WM_TAKE_FOCUS is present, but InputField set to 0.

xprop | grep -i focus gives
_XSETFOCUS_TIMESTAMP(_XSETFOCUS_TIMESTAMP) = 0x66, 0x6f, 0x6f
Client accepts input or input focus: False
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS

ICCCM says:
Globally Active Input - The client expects keyboard input and explicitly sets the input focus [...] Thus, it wants to prevent the window manager from setting the input focus to any of its windows.
..and further...
Globally Active clients set the input field to False , which requests that the window manager not set the input focus to their top-level window.

I'm not sure that this is the real cause of the problem. However, I made one interesting experiment: I wrote a program which calls XSetInputFocus on IDEA window, and sends WM_TAKE_FOCUS XEvent to it. This combination fully restores the focus, and typing works again. But as soon as program is chaned to only call XSetInputFocus (without sending WM_TAKE_FOCUS message), focus returns only 'partially' and caret doesn't appear.

It is probably a JDK bug, but I wonder why other swing apps aren't affected..


Keith Lea - 19 Sep 06 00:31
This affects me and almost everyone I work with. It happens to me several times per week and requires restarting IDEA and reopening all projects. It wastes lots of my time. I think it should be marked for demetra final.

Vladislav Kaznacheev - 10 Oct 06 19:27
I have just moved this issue to the Next Version. This is not because we do not care, but because we still cannot reproduce the problem.

We are going to focus on reproducing this right after 6.0.2. This is all I can promise for now.


Niklas Herder - 10 Oct 06 21:25
I've run JDK 1.5.0_08 for a few weeks now, and I haven't seen the problem so far. I would guess that it's a Swing bug that's been fixed with the -08 release.

Does anyone still have this problem with the latest SDK?


Per Leine - 10 Oct 06 22:12
I.ve encountered it a few times with JDK 1.5.0_08 on Linux kernel 2.6.15-27-386, Ubuntu dist. with KDE. But so far, I have never encountered it with Idea 6.0. I'll post if I see it in 6.0.

Venkat Sonnathi - 11 Oct 06 07:55