alderlopez / chromiumembedded

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

[mac] SetFocus(false) does nothing - the WebView remains focused #565

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. On a focused browser object, call SetFocus(false)
2. Focus is not remove from the WebView

What is the expected output? What do you see instead?
Focus should be removed from the WebView.

What version of the product are you using? On what operating system?
libcef/browser_impl_mac.mm r573 on Mac

Please provide any additional information below.

Original issue reported on code.google.com by ol...@adobe.com on 3 Apr 2012 at 8:02

GoogleCodeExporter commented 9 years ago
Hi, I'm also attaching a patch that calls makeFirstResponder:nil to take away 
the focus from the WebView, in case it has it. I'm assuming a non-null return 
from focusedFrame() means the WebView has focus. 

Original comment by ol...@adobe.com on 3 Apr 2012 at 8:17

Attachments:

GoogleCodeExporter commented 9 years ago
Unfortunately it looks like focusedFrame() always returns a non-null value via 
m_page->focusController()->focusedOrMainFrame(). I guess we could still have 
SetFocus() call makeFirstResponder:nil, or the client could call 
makeFirstResponder:nil directly on the parent window.

Original comment by magreenb...@gmail.com on 22 May 2012 at 4:03

GoogleCodeExporter commented 9 years ago
I have tried calling makeFirstResponder:nil directly on the parent window. This 
stops the blinking cursor on a previous focused text field on the html page, 
but the blue glow around the text box (on mac) is still there. Any ideas?

Original comment by joe...@gmail.com on 26 Sep 2012 at 6:50

GoogleCodeExporter commented 9 years ago
This workaround does not work if off-screen rendering is used because the 
parent window does not actually contain a BrowserWebView, so we cannot make it 
to go out of focus by just calling makeFirstResponder:nil on the parent window. 
Do you have any other suggestions?

Original comment by joe...@gmail.com on 9 Oct 2012 at 11:47

GoogleCodeExporter commented 9 years ago
Attached is a small patch for cefclient that does the makeFirstResponder:nil 
call in windowDidResignKey:.

This hides the caret as before and it now appears to be removing the blue focus 
ring around the active input.

Original comment by gusver...@gmail.com on 3 Dec 2012 at 9:00

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 3 Dec 2012 at 9:34

GoogleCodeExporter commented 9 years ago
@comment#5: Thanks, added in trunk revision 1025 and 1364 branch revision 1026.

Original comment by magreenb...@gmail.com on 18 Jan 2013 at 5:31