google-code-export / javachromiumembedded

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

Multiple browser instances freezes application. #96

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download and extract JCEF windows distribution 1750.1738.91
1. Download and extract MainFrame.java available in the zip file attached.
2. Replace test.simple.MainFrame from the JCEF distribution with the one from 
the attachment.
3. Compile the application using compile.bat and JDK7.
4. Run the application using run.bat and JRE7.

What is the expected output? What do you see instead?
I expected to have two embedded browser panels, each displaying the google 
search page. However the application will either freeze before displaying the 
web pages, or the web pages will be displayed and the caret in the search box 
will swap between browsers in an infinite loop, freezing the application as 
focus get swapped between each browser component.

What version of the product are you using? On what operating system?
JCEF 1750.1738.91 with Jre1.7.0u51 on Windows 7, all 64-bit architecture.

Please provide any additional information below.
Each browser is added in the swing hierarchy in separate JPanels, which are 
children to a main JPanel which has a border layout. The child panels are 
placed WEST and EAST of the parent. However, if I place the browser components 
directly in the same parent panel instead, everything seems to work fine.

Sometimes the application will launch correctly, which leads me to believe 
there could be some sort of race condition going on with component focus.

Adding a CefFocusHandler and returning true for onSetFocus fixes the problem, 
however clicking inside a browser steals the keyboard focus from the entire 
application forever. Clicking back on any swing component will receive the 
mouse focus, but keyboard event will be sent to the browser.

Original issue reported on code.google.com by zoltanma...@gmail.com on 27 Jun 2014 at 5:13

Attachments:

GoogleCodeExporter commented 9 years ago
Please see the patch file @comment#1 of issue 42.
It fixes the last part of this issue "[...] clicking inside a browser steals 
the keyboard focus [...] forever."

@zoltanma:
Maybe the patch fixes @issue 42 fixes this one completely. Please try it on 
your machine...

Original comment by k...@censhare.de on 9 Sep 2014 at 12:36

GoogleCodeExporter commented 9 years ago
@zoltanmantric: Please re-test with the fix from issue #42 and report back if 
the problem still occurs for you.

Original comment by magreenb...@gmail.com on 29 Sep 2014 at 4:51

GoogleCodeExporter commented 9 years ago
I can confirm that this issue is fixed in the latest version of the codebase, 
most likely due to the fix for issue 42.

@magreenblatt, on that subject, when is there likely to be a new official build 
of CEF and JCEF?  I'd really love to be able to pick this fix up from the 
official binary downloads as building it yourself takes quite some effort due 
to the required installs (WDK and so on).  I'm sure that there are many others 
who'd love to pick up these fixes too.

Original comment by sciv...@gmail.com on 8 Jan 2015 at 4:19

GoogleCodeExporter commented 9 years ago
@#3: Thanks for the update. There is currently no set schedule for official 
builds of JCEF. You can get CEF builds from http://cefbuilds.com.

Original comment by magreenb...@gmail.com on 8 Jan 2015 at 4:23