by Phylanx » Tue Apr 26, 2022 1:46 am
As far as I know this could be a problem on the jcef java/native bridge.
The Components that you get by getComponent (I only know the windowed rendering mode with Operating System Windows 32 bit) is a Java Swing JPanel that contains a Java AWT Canvas.
The background on that:
AWT has real windows operating system component handles on every component. e.g.:a java.awt.Button is a real Microsoft Windows Operating System Button.
Swing is different.
A Swing component is just drawn by java on a plain window component (as far as I know that is the only real OS handle it has).
So if you have a JButton on in a window, the button is just drawn (no real OS handle in there). For the OS a click on the JButton is a click on a bare and plain window, only Java knows that a JButton is located on this location and translates the Events (OnClick, OnMouseOver, OnMouseLeft, Drag,...).
Now if you take a AWT Button and put it for example in a Swing JPanel this needs some special usecases...
With this knowledge in background let's take a look on the JCEF Components.
JCEFs getComponent gives you a JPanel. That is because Swing is very commonly used in Java and also very recommended.
In this Swings JPanel there lies a Canvas.
The reason in this is that the Chromium native libraries deep down below don't know of Javas Swing technology. They need a real OperatingSystem Component handle to draw on it.
And this is the Canvas used for AWT.
As you can imagine it is a hack of work to translate all Events that happen in the JCEF/CEF binaries so that Javas Swing JPanel and Java itself gets all needed Events.
JCEF had its problems (including painfull JVM Crashes) with it and has small issues still.
As far as I can say to the topic "Focus handling in JCEF" I would say this:
The less you meddle with it the better it works.
------------
btw... is there a reason why you can't use the normal Operating systems keyboard?
doesn't the OperatingSystem recognize that you focussed a component that should enable the virtual keyboard?