Commit 8effab9d authored by aroben@apple.com's avatar aroben@apple.com

Don't ever call ::SetCursor(0)

Doing so makes the cursor disappear from the screen.

Fixes <http://webkit.org/b/52024> Mouse cursor flashes when moving it
around a WKView before the web process has finished launching

Reviewed by Jon Honeycutt.

* UIProcess/win/WebView.cpp:
(WebKit::WebView::onSetCursor): If we don't have a cursor to set, just
let Windows do its default thing (which is to set the cursor to the
window class's cursor, which in our case is the arrow cursor).
(WebKit::WebView::cursorToShow): Just return 0 when the page has
crashed so that we'll show the default cursor (which is the arrow
cursor). This change has no visible effect, but seems slightly better
conceptually.
(WebKit::WebView::updateNativeCursor): Don't do anything if we don't
have a cursor to set.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75268 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 75bf8e69
2011-01-06 Adam Roben <aroben@apple.com>
Don't ever call ::SetCursor(0)
Doing so makes the cursor disappear from the screen.
Fixes <http://webkit.org/b/52024> Mouse cursor flashes when moving it
around a WKView before the web process has finished launching
Reviewed by Jon Honeycutt.
* UIProcess/win/WebView.cpp:
(WebKit::WebView::onSetCursor): If we don't have a cursor to set, just
let Windows do its default thing (which is to set the cursor to the
window class's cursor, which in our case is the arrow cursor).
(WebKit::WebView::cursorToShow): Just return 0 when the page has
crashed so that we'll show the default cursor (which is the arrow
cursor). This change has no visible effect, but seems slightly better
conceptually.
(WebKit::WebView::updateNativeCursor): Don't do anything if we don't
have a cursor to set.
2011-01-06 Adam Roben <aroben@apple.com>
Fill the WKView with white when the web process hasn't drawn anything
......@@ -482,7 +482,12 @@ LRESULT WebView::onShowWindowEvent(HWND hWnd, UINT message, WPARAM wParam, LPARA
LRESULT WebView::onSetCursor(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool& handled)
{
handled = ::SetCursor(m_lastCursorSet);
if (!m_lastCursorSet) {
handled = false;
return 0;
}
::SetCursor(m_lastCursorSet);
return 0;
}
......@@ -625,12 +630,11 @@ void WebView::toolTipChanged(const String&, const String& newToolTip)
HCURSOR WebView::cursorToShow() const
{
static HCURSOR arrowCursor = ::LoadCursor(0, IDC_ARROW);
if (!m_page->isValid())
return arrowCursor;
return 0;
// We only show the override cursor if the default (arrow) cursor is showing.
static HCURSOR arrowCursor = ::LoadCursor(0, IDC_ARROW);
if (m_overrideCursor && m_webCoreCursor == arrowCursor)
return m_overrideCursor;
......@@ -640,6 +644,8 @@ HCURSOR WebView::cursorToShow() const
void WebView::updateNativeCursor()
{
m_lastCursorSet = cursorToShow();
if (!m_lastCursorSet)
return;
::SetCursor(m_lastCursorSet);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment