Skip to content
Permalink
Browse files
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.

Canonical link: https://commits.webkit.org/65589@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75268 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aroben committed Jan 7, 2011
1 parent 8779c97 commit 7dafeb9c1826f6cdbc49dea4980ccc932e6993c2
Showing with 32 additions and 4 deletions.
  1. +22 −0 WebKit2/ChangeLog
  2. +10 −4 WebKit2/UIProcess/win/WebView.cpp
@@ -1,3 +1,25 @@
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);
}

0 comments on commit 7dafeb9

Please sign in to comment.