Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No visible cursor on text fields in OSR mode #24

Closed
magreenblatt opened this issue Jan 6, 2014 · 13 comments
Closed

No visible cursor on text fields in OSR mode #24

magreenblatt opened this issue Jan 6, 2014 · 13 comments
Labels
bug Bug report

Comments

@magreenblatt
Copy link
Collaborator

Original report by Anonymous.


Original issue 24 created by arnaud.brochard on 2014-01-06T12:56:37.000Z:

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

@magreenblatt
Copy link
Collaborator Author

Original comment by Anonymous.


Comment 1. originally posted by leichtenfels on 2014-01-13T09:03:47.000Z:

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

@magreenblatt
Copy link
Collaborator Author

Comment 2. originally posted by magreenblatt on 2014-01-13T15:05:48.000Z:

@ commentcomment 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.

@magreenblatt
Copy link
Collaborator Author

  • set state to "open"

@magreenblatt
Copy link
Collaborator Author

Original comment by Anonymous.


Comment 4. originally posted by arnaud.brochard on 2014-01-13T16:58:47.000Z:

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)...

@magreenblatt
Copy link
Collaborator Author

Comment 5. originally posted by magreenblatt on 2014-04-11T16:27:05.000Z:

You can avoid this issue by using the windowed rendering mode supported by newer JCEF revisions.

@magreenblatt
Copy link
Collaborator Author

Comment 6. originally posted by magreenblatt on 2014-06-17T18:16:46.000Z:

@magreenblatt
Copy link
Collaborator Author

Original comment by Anonymous.


Comment 7. originally posted by arnaud.brochard on 2014-06-19T08:23:15.000Z:

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)

@magreenblatt
Copy link
Collaborator Author

Comment 8. originally posted by magreenblatt on 2014-11-20T20:11:28.000Z:

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

@magreenblatt
Copy link
Collaborator Author

Original comment by Anonymous.


Comment 9. originally posted by philippe.defert on 2014-12-15T09:06:12.000Z:

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()

@magreenblatt
Copy link
Collaborator Author

Original comment by Rupert Smith (Bitbucket: rupertlssmith, GitHub: rupertlssmith).


Comment 10. originally posted by rupertlssmith on 2014-12-15T10:19:59.000Z:

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

@magreenblatt
Copy link
Collaborator Author

Original comment by Anonymous.


Comment 11. originally posted by philip142au on 2015-01-17T04:02:38.000Z:

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);  
  }  
}); 

@magreenblatt
Copy link
Collaborator Author

Duplicate of #180.

@magreenblatt
Copy link
Collaborator Author

  • changed state from "new" to "duplicate"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report
Projects
None yet
Development

No branches or pull requests

1 participant