pottermm / javachromiumembedded

Automatically exported from code.google.com/p/javachromiumembedded
0 stars 0 forks source link

No visible cursor on text fields in OSR mode #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Download and run latest distribution

What is the expected output? What do you see instead?

Expected behavior is a visible and blinking cursor on text fields. But no 
cursor is visible at all.

What version of the product are you using? On what operating system?

jcef_binary_3.1650.1501.9_windows64_preview
Windows 7 x64
JDK7u45 x64

Also tried with win32, same behavior

Please provide any additional information below.

In debug mode, the onCursorChange method of the MainFrame class is often 
called, but no cursor is visible

Original issue reported on code.google.com by arnaud.b...@gmail.com on 6 Jan 2014 at 12:56

GoogleCodeExporter commented 9 years ago
I am having the same issue.

I just built JCEF according to the instructions (Windows 7 x64, JDK 7u45 x64). 
Had to add NULL as value for the windows_sandbox_info parameter of function 
calls to CefInitialize and CefExecuteProcess to get it compiled.

Caret behaviour is indeed very strange. Navigation with cursor keys has no 
effect, also, Shift + cursor key doesn't select text as usual. Home and End 
keys don't work, either. Mouse selection does work, however.

I suspect it's not just an issue with the caret not being displayed, but some 
deeper problem. Looks to me as if caret events are not passed to the underlying 
control.

I'm just evaluating JCEF for a project and, unfortunately, this issue is a 
showstopper for me. I tried to build the cefclient2010 project to investigate 
whether this might be a Windows issue but I'm getting a build error I can't 
resolve (MSB6006: cmd.exe exited with code 4; no helpful information on Google 
found on this).

If I can be of any assistance in resolving this problem please don't hesitate 
to contact me. I can also offer some development resources for JCEF in exchange 
for being able to use it (I'm a fairly competent Java developer with JNI 
experience and some experience in C and C++).

Thanks, Leo

Original comment by leichten...@gmail.com on 13 Jan 2014 at 9:03

GoogleCodeExporter commented 9 years ago
@comment#1: JCEF is currently demo/prerelease quality, so there will likely be 
a lot of showstopper issues :). In this particular case we may not be setting 
the focus correctly after creating the off-screen browser.

All of the source code for JCEF is available. Feel free to submit issues and/or 
patches for any problems that you run into. You can also ask questions at 
http://magpcss.org/ceforum.

Original comment by magreenb...@gmail.com on 13 Jan 2014 at 3:05

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I also suspect there's a collection of small issues :

- I solved the tab situation with a simple 
canvas_.setFocusTraversalKeysEnabled(false)

- Arrow keys are not responding on a Windows machine (probably some 
wrong/missing code in Java_org_cef_CefBrowser_1N_N_1SendKeyEvent, I'll try to 
debug it)

- Cursor is still missing (no idea here)...

Original comment by arnaud.b...@gmail.com on 13 Jan 2014 at 4:58

GoogleCodeExporter commented 9 years ago
You can avoid this issue by using the windowed rendering mode supported by 
newer JCEF revisions.

Original comment by magreenb...@gmail.com on 11 Apr 2014 at 4:27

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 17 Jun 2014 at 6:16

GoogleCodeExporter commented 9 years ago
Just rebuilt and tested latest revision (r90 along up-to-date CEF), confirmed 
the cursor issue is fixed in window rendering mode (but not in OSR mode, as 
indicated)

Original comment by arnaud.b...@gmail.com on 19 Jun 2014 at 8:23

GoogleCodeExporter commented 9 years ago
This can probably be fixed for off-screen rendering by calling 
CefBrowserHost::SendFocusEvent when the Java canvas receives focus.

Original comment by magreenb...@gmail.com on 20 Nov 2014 at 8:11

GoogleCodeExporter commented 9 years ago
I found a workaround 

browser_ = client_.createBrowser(startURL, useOSR, isTransparent);
browerUI_ = browser_.getUIComponent();
browerUI_.addFocusListener(new FocusListener() {

            @Override
            public void focusLost(FocusEvent e) {
                browser_.setFocus(false);
            }

            @Override
            public void focusGained(FocusEvent e) {
                browser_.setFocus(true);
            }
        }); 
    }

You can put in  org.cef.browser.CefBrowserOsr.java in createGLCanvas()

Original comment by philippe...@gmail.com on 15 Dec 2014 at 9:06

GoogleCodeExporter commented 9 years ago
To confirm, I just tried the .setFocus workaround in OSR mode on Linux, and it 
works perfectly. Thanks for that.

Original comment by rupertls...@googlemail.com on 15 Dec 2014 at 10:19

GoogleCodeExporter commented 9 years ago
Hi, so I came across the same issue. Maybe the code has changed since your last 
comment, so I had to add in MainFrame.java around line 224:

    browser_ = client_.createBrowser("http://www.google.com",
                                     osrEnabled,
                                     false,
                                     requestContext);
    browser_.getUIComponent().addFocusListener(new FocusListener() {

      @Override
      public void focusLost(FocusEvent e) {
        browser_.setFocus(false);
      }

      @Override
      public void focusGained(FocusEvent e) {
        browser_.setFocus(true);
      }
    }); 

Original comment by philip142au@gmail.com on 17 Jan 2015 at 4:02

GoogleCodeExporter commented 9 years ago
JCEF is transitioning from Google Code to Bitbucket project hosting. If you 
would like to continue receiving notifications on this issue please add 
yourself as a Watcher at the new location: 
https://bitbucket.org/chromiumembedded/java-cef/issue/24

Original comment by magreenb...@gmail.com on 18 Mar 2015 at 5:59