pacificIT / chromiumembedded

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

CEF3: Browser view is unresponsive after minimize and restore #606

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
CEF3 revision 651.
Windows 7 64bit.

What steps will reproduce the problem?
1. Launch cefclient and see the google homepage.
2. Minimize cefclient and restore it by clicking on the task bar icon.
3. Move the mouse around the browser view, the mouse cursor does not turn into 
an I-beam or a pointing hand when appropriate, and the page does not respond to 
events such as clicking links.
4. Resize the window and the page becomes responsive again.

Related forum post: http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=801

Original issue reported on code.google.com by magreenb...@gmail.com on 25 May 2012 at 9:14

GoogleCodeExporter commented 9 years ago
The problem is that, after restoring the window, RenderLayer::hitTest does not 
find a Node matching the mouse position. Call stack:

>   libcef.dll!WebCore::RenderLayer::hitTest(const WebCore::HitTestRequest & 
request, WebCore::HitTestResult & result)  Line 3354    C++
    libcef.dll!WebCore::RenderView::hitTest(const WebCore::HitTestRequest & request, WebCore::HitTestResult & result)  Line 83  C++
    libcef.dll!WebCore::Document::prepareMouseEvent(const WebCore::HitTestRequest & request, const WebCore::FractionalLayoutPoint & documentPoint, const WebCore::PlatformMouseEvent & event)  Line 3078    C++
    libcef.dll!WebCore::EventHandler::prepareMouseEvent(const WebCore::HitTestRequest & request, const WebCore::PlatformMouseEvent & mev)  Line 2086 + 0x39 bytes   C++
    libcef.dll!WebCore::EventHandler::handleMouseMoveEvent(const WebCore::PlatformMouseEvent & mouseEvent, WebCore::HitTestResult * hoveredNode, bool onlyUpdateScrollbars)  Line 1765  C++
    libcef.dll!WebKit::PageWidgetEventHandler::handleMouseLeave(WebCore::Frame & mainFrame, const WebKit::WebMouseEvent & event)  Line 198 + 0x29 bytes C++
    libcef.dll!WebKit::WebViewImpl::handleMouseLeave(WebCore::Frame & mainFrame, const WebKit::WebMouseEvent & event)  Line 494 C++
    libcef.dll!WebKit::PageWidgetDelegate::handleInputEvent(WebCore::Page * page, WebKit::PageWidgetEventHandler & handler, const WebKit::WebInputEvent & event)  Line 121 + 0x17 bytes C++
    libcef.dll!WebKit::WebViewImpl::handleInputEvent(const WebKit::WebInputEvent & inputEvent)  Line 1713 + 0x34 bytes  C++
    libcef.dll!RenderWidget::OnHandleInputEvent(const IPC::Message & message)  Line 551 + 0x1b bytes    C++

Consequently targetNode and m_nodeUnderMouse are always NULL in 
EventHandler::updateMouseEventTargetNode and Node::dispatchMouseEvent is never 
called.

Original comment by magreenb...@gmail.com on 25 May 2012 at 10:17

GoogleCodeExporter commented 9 years ago
The size of the FrameView is being set to (0,0) when the window is minimized 
and is not being set back to the proper size when the window is restored. 
Originating call stack for the (0,0) size:

>   libcef.dll!content::RenderWidgetHostImpl::WasResized()  Line 427    C++
    libcef.dll!RenderWidgetHostViewWin::SetBounds(const gfx::Rect & rect)  Line 445 + 0x32 bytes    C++
    libcef.dll!RenderWidgetHostViewWin::SetSize(const gfx::Size & size)  Line 426 + 0x3e bytes  C++
    libcef.dll!WebContentsViewWin::OnWindowPosChanged(unsigned int message, unsigned int wparam, long lparam, int & handled)  Line 374 + 0x13 bytes C++
    libcef.dll!WebContentsViewWin::_ProcessWindowMessage(HWND__ * hWnd, unsigned int uMsg, unsigned int wParam, long lParam, long & lResult, unsigned long dwMsgMapID)  Line 36 + 0x25 bytes    C++
    libcef.dll!WebContentsViewWin::ProcessWindowMessage(HWND__ * hWnd, unsigned int uMsg, unsigned int wParam, long lParam, long & lResult, unsigned long dwMsgMapID)  Line 34 + 0x4a bytes C++
    libcef.dll!ui::WindowImpl::OnWndProc(unsigned int message, unsigned int w_param, long l_param)  Line 211 + 0x27 bytes   C++
    libcef.dll!ui::WindowImpl::WndProc(HWND__ * hwnd, unsigned int message, unsigned int w_param, long l_param)  Line 239 + 0x1b bytes  C++

Original comment by magreenb...@gmail.com on 25 May 2012 at 10:41

GoogleCodeExporter commented 9 years ago
The bug appears to be in CefBrowserHostImpl handling of the WM_SIZE message. We 
shouldn't be calling MoveWindow when the window is minimized.

Original comment by magreenb...@gmail.com on 25 May 2012 at 10:44

GoogleCodeExporter commented 9 years ago
Fixed in revision 653.

Original comment by magreenb...@gmail.com on 29 May 2012 at 5:39

GoogleCodeExporter commented 9 years ago
Reproduced the bug on cef_binary_3.1180.823.

A workaround is to check the size of the window, and if it's 0 by 0 then don't 
DeferWindowPos() to the browser window handle.

Original comment by garon...@gmail.com on 18 Oct 2012 at 1:42