Focus handling questions

Roman Kennke roman at kennke.org
Wed Aug 10 10:54:36 PDT 2011


Hi Clemens,

Yeah I found this a little surprising as well. I believe the
KeyboardFocusHandler should be shielded by the AppContext just like
(almost) anything else. I even mentioned this just ~2weeks ago to the
awt-dev list and only got the reply that this is not considered
important. The problem is that nobody ever considered that 2 clients
could be run off one VM but on different machines (as you do). The
'worst' you can get with standard Java is 2 (or more) applets in one
browser in which case only one ever could get focused. Even if you run a
Java app through an X tunnel, this would be running in 1 app / JVM, so
not a big deal either. You bring Java's graphics stack to completely
unknown frontiers ;-) Long story short, the KFM  needs to be shielded by
the AppContext, I doubt that just doing the peers would be enough since
the KFM holds some 'global' things like the current focused window. In
static fields... I would support such a refactoring, but expect it to be
a rough way to go into JDK :-) (but not impossible either, considering
what we did with the FontManager...)

Cheersors, Roman

Am Mittwoch, den 10.08.2011, 17:36 +0200 schrieb Clemens Eisserer:
> Hi,
> 
> I have some difficulties with focus handling which doesn't seem to be
> shielded by AppContexts - e.g. if two users are entering text only one
> user gets his textfield focused. I had a look at java's focus handling
> code, but I don't really understand whats going on where.
> 
> I guess I have to create per-app-context instances of both
> sun.awt.peer.cacio.managed.FocusManager as well as
> CacioKeyboardFocusManagerPeer, however that doesn't seem sufficient.
> Already played arround with it a bit :/
> 
> Any hints where I should start looking at first?
> 
> Thank you in advance, Clemens





More information about the caciocavallo-dev mailing list