Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Unified Diff: ui/aura/root_window_host_linux.cc

Issue 9463003: aura-x11: Add custom web cursor support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/aura/root_window_host_linux.cc
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index b3b32c5e946e0e97253def6c6cba5da08c493b03..da68544c488cd633032ff27bcf728f00a6e260de 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -78,7 +78,7 @@ void CheckXEventForConsistency(XEvent* xevent) {
// Returns X font cursor shape from an Aura cursor.
int CursorShapeFromNative(gfx::NativeCursor native_cursor) {
- switch (native_cursor) {
+ switch (native_cursor.native_type()) {
case aura::kCursorNull:
return XC_left_ptr;
case aura::kCursorPointer:
@@ -154,9 +154,11 @@ int CursorShapeFromNative(gfx::NativeCursor native_cursor) {
case aura::kCursorZoomOut:
case aura::kCursorGrab:
case aura::kCursorGrabbing:
- case aura::kCursorCustom:
// TODO(jamescook): Need cursors for these. crbug.com/111650
return XC_left_ptr;
+ case aura::kCursorCustom:
+ NOTREACHED();
+ return XC_left_ptr;
}
NOTREACHED();
return XC_left_ptr;
@@ -547,10 +549,6 @@ void RootWindowHostLinux::SetCursor(gfx::NativeCursor cursor) {
return;
current_cursor_ = cursor;
- // Custom web cursors are handled directly.
- if (cursor == kCursorCustom)
- return;
-
if (cursor_shown_)
SetCursorInternal(cursor);
}
@@ -646,6 +644,8 @@ void RootWindowHostLinux::SetCursorInternal(gfx::NativeCursor cursor) {
::Cursor xcursor =
cursor == kCursorNone ?
invisible_cursor_ :
+ cursor == kCursorCustom ?
+ cursor.platform() :
ui::GetXCursor(CursorShapeFromNative(cursor));
XDefineCursor(xdisplay_, xwindow_, xcursor);
}
« ui/aura/cursor.h ('K') | « ui/aura/cursor_x11.cc ('k') | ui/aura/root_window_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698