Keyboard focus lost in Swing applications (ex: Netbeans) after changing to window

2009-01-15 Thread Daniel Clemente

Hi, sorry if this message comes twice (I posted yesterday via NNTP without 
being subscribed to the list).


  ion3 is stealing keyboard focus to Swing applications. This happens for 
instance with Netbeans 6.5:

1. Open netbeans and some other programs in tabs next to it.
2. Select netbeans and open an editor with some code; the cursor is inside the 
editor
3. Select another tab (either clicking teh tab or with keyboard).
4. Select netbeans again (either clicking the tab or with keyboard).
5. Try to continue typing, but you can't. The cursor is nowhere, and *no key* 
works (space, cursors, A-S-o, ... all gone). You must click again in the editor 
and then you can type again.

In fact any Swing application has this problem. You can use this one to test:

--- TypeInSwing.java 

import javax.swing.JFrame;
import javax.swing.JTextField;

public class TypeInSwing {
  public static void main(String[] args) {
JFrame frame = new JFrame(HelloWorldSwing);
final JTextField field = new JTextField(type here);

frame.getContentPane().add(field);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
  }
}

--

It happens with latest version 20090110 (with 20080207 too).

I am using:

$ java -version
java version 1.6.0_06
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)


  Why is it so?


Daniel




Re: Keyboard focus lost in Swing applications (ex: Netbeans) after changing to window

2009-01-15 Thread Tuomo Valkonen
On 2009-01-15, Daniel Clemente dcl441-b...@yahoo.com wrote:
 In fact any Swing application has this problem. You can use this one to test:

CBA going through all the trouble of installing java compilers
and whatever dependencies there may be. Java on Linux is pain;
already been too much trouble installing the VM back in the day.

   Why is it so?

Probably because Swing is crap and sets the focus somewhere where
it shouldn't be -- in violation of the ICCCM. X doesn't forward 
focus changes to the WM is requests, but rather obeys each and 
every one (unless the target window is hidden, etc.), so the 
WM should have to start fighting agianst them.

-- 
In 1995, Linux was almost a bicycle; an alternative way of live to the
Windows petrol beasts that had to be taken to the dealer for service.
By 2008, Linux has bloated into a gas-guzzler, and the cycle paths 
have been replaced with polluted motorways.



Re: Keyboard focus lost in Swing applications (ex: Netbeans) after changing to window

2009-01-15 Thread Sylvain Abélard
 Java on Linux is pain
But the MacOS JVM sucks,
the Windows ecosystem makes Java not portable,
the exotic platforms Java Editions lacks the libraries (not portable again),
and Java for the web was stillborn, dead, resurrected and will keep
being a zombie.

Java is pain is enough.

-- 
Sylvain Abélard
J'ai décidé d'être heureux, c'est meilleur pour la santé. -Voltaire


Multi-, different- monitors is multi-hopeless?

2009-01-15 Thread Benjamin R. Haskell
I have a laptop with an LCD w/ 1280x800 resolution, and an external CRT 
that's either at 1024x768, 1280x960, or unavailable (depending on whether 
I'm at work, home, or somewhere else, respectively).



Here's what I've settled on in Enlightenment (E17): I have four desktops 
on each monitor. Alt+F1 through Alt+F4 jump to their respective desktops. 
Alt+F? on the LCD doesn't change the desktop on the CRT. Alt+F? on the CRT 
doesn't change the desktop on the LCD. They're independent. The 'xrandr' 
command allows me to switch the CRT to one of the three modes I need 
(work/home/off).


But, really, the only reason I've stayed with E17 so long is that it's the 
only window manager that handles multi-monitors the way I want it done. A 
lot of the choices behind Ion jive really well with what I actually want 
in a WM. (keyboard über alles, window manager that actually *manages*, and 
Lua(yay!))



Based mostly on the latest Shit-or-rama [Was: mod_xinerama] thread [1], 
I'm not optimistic about Ion emulating this setup. But is it an accurate 
statement that there is no nice way to use ion3 such that I get:


1. per-monitor workspaces

2. ability to move windows between monitors

3. ability to switch CRT resolution/presence w/out restarting X

(...part of the difficulty being that my monitor heights don't match up)


If it's true that there's no nice way: does anyone have convoluted 
workarounds or horrible hacks that might require lots of setup (but 
minimal effort thereafter) that manage to achieve these goals?


As an example of horrible/convoluted: several months ago, when I last 
went through a This window manager sucks; I should try some new ones that 
support my monitors phase, I was optimistic about XMOVE: A pseudoserver 
for X window movement [2]. Or maybe running a couple or several X VNC 
servers would work.  E.g. left half (LCD) = frame with Xvnc :0 and Xvnc 
:1, right half (CRT) = frame with Xvnc :2. Then moving windows 
becomes: close vncviewer :1 on LCD, open it on CRT.



And, if it's true that there's not even a horrible way to get all three, 
what are the various X settings that I need to enable/disable to get 2/3 
of the desired properties (Looks easiest to sacrifice ability to move 
windows between monitors)?


Obviously: disable XRandR and Xinerama. (Problem there: I can't seem to 
find the correct incantation to disable Xinerama. I'm planning to just 
recompile X without it.
...Though another workaround (rename Xiner SHIToR /usr/lib/libXiner* ) is 
slightly more amusing.)


and in xorg.conf, I'd need:

three Monitor sections: 1 for LCD, 1 for home CRT, 1 for work CRT
three Screen sections: 1 for 1280x800, 1 for 1280x960, 1 for 1024x768
three ServerLayout sections: 1 for LCD+home, 1 for LCD+work, 1 for LCD-only

Sound right?

Thanks for any help. I really like everything I've seen in Ion so far, 
except for this multi-monitor business. (And I realize it's not Ion that's 
to blame.)


Best,
Ben



[1] Shit-or-rama [Was: mod_xinerama]
https://lists.berlios.de/pipermail/ion-general/2008-September/002190.html

[2] XMOVE: A pseudoserver for X Window movement
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.30.589