Focus handler methods not called in offscreen browser

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Focus handler methods not called in offscreen browser

Postby mikebei » Tue Feb 02, 2016 10:41 am

Using the CEF wrapper CEFSharp for my .NET app, I can use the keyboard's Tab key to cycle through my app's controls and into the CEF browser. Once focus makes it to CEF, the Tab key will cycle through the elements of the currently loaded page, as expected. When focus reaches the end of the page, it loops back to the first page element. I have implemented the browser's focus handler to try to pull focus back to my app after focus reaches the bottom of the page, but it appears that the handler's methods are not properly called for offscreen browsers. I see OnSetFocus() get called once but no other focus handler methods ever get called after that.

How can I detect when focus has reached the end of my page?
mikebei
Newbie
 
Posts: 4
Joined: Tue Feb 02, 2016 10:30 am

Re: Focus handler methods not called in offscreen browser

Postby magreenblatt » Tue Feb 02, 2016 11:18 am

OnTakeFocus should be called. You can ask on a CefSharp support channel whether it's a known problem.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Focus handler methods not called in offscreen browser

Postby mikebei » Tue Feb 02, 2016 11:40 am

Sorry, should have mentioned this in my original post...I had originally posted this question on StackOverflow here: http://stackoverflow.com/questions/3514 ... m-cefsharp. I got a response from CEFSharp's top contributor (by a large margin), stating "Known problem for which there is currently no workaround unfortunately. It's a bug in CEF (CefSharp is just a wrapper). The OnTakeFocus method is never called when using Offscreen Rendering, which is what the WPF control uses."

I also found an issue listed in the CEF Bitbucket project that matches what I am experiencing here: https://bitbucket.org/chromiumembedded/ ... not-called. The problem with that issue is it was listed as specifically affecting OSX and was marked as a duplicate for another issue, which to me looks like a separate OSX-specific issue.

Not sure what to think from there and I can't read through C++ well enough to follow exactly what may be the cause.
mikebei
Newbie
 
Posts: 4
Joined: Tue Feb 02, 2016 10:30 am

Re: Focus handler methods not called in offscreen browser

Postby magreenblatt » Tue Feb 02, 2016 11:58 am

What CEF version are you using?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Focus handler methods not called in offscreen browser

Postby mikebei » Tue Feb 02, 2016 12:16 pm

I'm using 3.2526.1362, which is the version that the latest CEFSharp stable release has set as a dependency.
mikebei
Newbie
 
Posts: 4
Joined: Tue Feb 02, 2016 10:30 am

Re: Focus handler methods not called in offscreen browser

Postby amaitland » Tue Feb 02, 2016 9:11 pm

I can confirm that OnTakeFocus is not called when using OSR rendering in the context of `CefSharp`. I haven't checked `cefclient`, though I suspect the problem will exist there also.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Focus handler methods not called in offscreen browser

Postby magreenblatt » Tue Feb 02, 2016 9:25 pm

Please add a bug.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Focus handler methods not called in offscreen browser

Postby mikebei » Thu Feb 04, 2016 3:44 pm

It was hard for me to provide much in the way of useful details, but I created an issue here:
https://bitbucket.org/chromiumembedded/ ... -offscreen
mikebei
Newbie
 
Posts: 4
Joined: Tue Feb 02, 2016 10:30 am


Return to Support Forum

Who is online

Users browsing this forum: civilogic and 96 guests