summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 18:29:00 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 18:29:00 +0000
commit4b576875ad1b570c3f34f549df27b9e98941dac7 (patch)
treebb81526cf40e2843e51c3548d9a13ce0c4605cd4 /webkit
parent0e6fe11ed699d693198e928723fc4afb13bba729 (diff)
downloadchromium_src-4b576875ad1b570c3f34f549df27b9e98941dac7.zip
chromium_src-4b576875ad1b570c3f34f549df27b9e98941dac7.tar.gz
chromium_src-4b576875ad1b570c3f34f549df27b9e98941dac7.tar.bz2
Don't override user's default cursor with GDK_ARROW.
BUG=8786 Review URL: http://codereview.chromium.org/42587 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12474 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webcursor.h3
-rw-r--r--webkit/glue/webcursor_gtk.cc46
-rwxr-xr-xwebkit/tools/test_shell/test_webview_delegate_gtk.cc8
3 files changed, 31 insertions, 26 deletions
diff --git a/webkit/glue/webcursor.h b/webkit/glue/webcursor.h
index 1dbf3c3..a46f881 100644
--- a/webkit/glue/webcursor.h
+++ b/webkit/glue/webcursor.h
@@ -73,7 +73,8 @@ class WebCursor {
#elif defined(OS_LINUX)
// Return the stock GdkCursorType for this cursor, or GDK_CURSOR_IS_PIXMAP
- // if it's a custom cursor.
+ // if it's a custom cursor. Return GDK_LAST_CURSOR to indicate that the cursor
+ // should be set to the system default.
GdkCursorType GetCursorType() const;
// Return a new GdkCursor* for this cursor. Only valid if GetCursorType
diff --git a/webkit/glue/webcursor_gtk.cc b/webkit/glue/webcursor_gtk.cc
index 0fc03c0..d95bc1b 100644
--- a/webkit/glue/webcursor_gtk.cc
+++ b/webkit/glue/webcursor_gtk.cc
@@ -49,7 +49,7 @@ GdkCursorType WebCursor::GetCursorType() const {
// change everything.
switch (type_) {
case PlatformCursor::TypePointer:
- return GDK_ARROW;
+ return GDK_LAST_CURSOR;
case PlatformCursor::TypeCross:
return GDK_CROSS;
case PlatformCursor::TypeHand:
@@ -77,62 +77,62 @@ GdkCursorType WebCursor::GetCursorType() const {
case PlatformCursor::TypeWestResize:
return GDK_LEFT_SIDE;
case PlatformCursor::TypeNorthSouthResize:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeEastWestResize:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeNorthEastSouthWestResize:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeNorthWestSouthEastResize:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeColumnResize:
return GDK_SB_H_DOUBLE_ARROW; // TODO(evanm): is this correct?
case PlatformCursor::TypeRowResize:
return GDK_SB_V_DOUBLE_ARROW; // TODO(evanm): is this correct?
case PlatformCursor::TypeMiddlePanning:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeEastPanning:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeNorthPanning:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeNorthEastPanning:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeNorthWestPanning:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeSouthPanning:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeSouthEastPanning:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeSouthWestPanning:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeWestPanning:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeMove:
return GDK_FLEUR;
case PlatformCursor::TypeVerticalText:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeCell:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeContextMenu:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeAlias:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeProgress:
return GDK_WATCH;
case PlatformCursor::TypeNoDrop:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeCopy:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeNone:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeNotAllowed:
- NOTIMPLEMENTED(); return GDK_ARROW;
+ NOTIMPLEMENTED(); return GDK_LAST_CURSOR;
case PlatformCursor::TypeZoomIn:
case PlatformCursor::TypeZoomOut:
case PlatformCursor::TypeCustom:
return GDK_CURSOR_IS_PIXMAP;
}
NOTREACHED();
- return GDK_ARROW;
+ return GDK_LAST_CURSOR;
}
GdkCursor* WebCursor::GetCustomCursor() const {
diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc
index 620de76..230eba4 100755
--- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc
+++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc
@@ -146,12 +146,16 @@ void TestWebViewDelegate::SetCursor(WebWidget* webwidget,
// non-pixmap branch.
if (cursor_type_ == cursor_type)
return;
- gdk_cursor = gdk_cursor_new(cursor_type);
+ if (cursor_type_ == GDK_LAST_CURSOR)
+ gdk_cursor = NULL;
+ else
+ gdk_cursor = gdk_cursor_new(cursor_type);
}
cursor_type_ = cursor_type;
gdk_window_set_cursor(shell_->webViewWnd()->window, gdk_cursor);
// The window now owns the cursor.
- gdk_cursor_unref(gdk_cursor);
+ if (gdk_cursor)
+ gdk_cursor_unref(gdk_cursor);
}
void TestWebViewDelegate::GetWindowRect(WebWidget* webwidget,