diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-08 23:39:05 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-08 23:39:05 +0000 |
commit | 7331eaf921e0714b8b158d3e8cf84a81f8370246 (patch) | |
tree | 6a6b9a37782a36d2a9976e13703658472131f92e /ui | |
parent | e87687feb9cace286a412def5e199033d3fe4fd1 (diff) | |
download | chromium_src-7331eaf921e0714b8b158d3e8cf84a81f8370246.zip chromium_src-7331eaf921e0714b8b158d3e8cf84a81f8370246.tar.gz chromium_src-7331eaf921e0714b8b158d3e8cf84a81f8370246.tar.bz2 |
aura: Implement cursor support on linux.
BUG=none
TEST=manually
Review URL: http://codereview.chromium.org/8205004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104663 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aura/desktop_host_linux.cc | 7 | ||||
-rw-r--r-- | ui/gfx/native_widget_types.h | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/ui/aura/desktop_host_linux.cc b/ui/aura/desktop_host_linux.cc index 6b5c14d..20112b1 100644 --- a/ui/aura/desktop_host_linux.cc +++ b/ui/aura/desktop_host_linux.cc @@ -37,6 +37,7 @@ class DesktopHostLinux : public DesktopHost { // The display and the native X window hosting the desktop. Display* xdisplay_; ::Window xwindow_; + Cursor xcursor_; // The size of |xwindow_|. gfx::Rect bounds_; @@ -48,6 +49,7 @@ DesktopHostLinux::DesktopHostLinux(const gfx::Rect& bounds) : desktop_(NULL), xdisplay_(NULL), xwindow_(0), + xcursor_(0), bounds_(bounds) { // This assumes that the message-pump creates and owns the display. xdisplay_ = base::MessagePumpX::GetDefaultXDisplay(); @@ -128,7 +130,10 @@ void DesktopHostLinux::SetSize(const gfx::Size& size) { } void DesktopHostLinux::SetCursor(gfx::NativeCursor cursor_type) { - NOTIMPLEMENTED(); + if (xcursor_ == cursor_type) + return; + xcursor_ = cursor_type; + XDefineCursor(xdisplay_, xwindow_, cursor_type); } } // namespace diff --git a/ui/gfx/native_widget_types.h b/ui/gfx/native_widget_types.h index 5ab07fc7..a960864 100644 --- a/ui/gfx/native_widget_types.h +++ b/ui/gfx/native_widget_types.h @@ -41,7 +41,12 @@ class SkRegion; namespace aura { class Window; } + +#if defined(USE_X11) +typedef unsigned long Cursor; #endif +#endif // defined(USE_AURA) + #if defined(OS_WIN) #include <windows.h> // NOLINT typedef struct HFONT__* HFONT; @@ -148,7 +153,7 @@ typedef void* NativeViewAccessible; typedef PangoFontDescription* NativeFont; typedef void* NativeEditView; typedef cairo_t* NativeDrawingContext; -typedef void* NativeCursor; +typedef Cursor NativeCursor; typedef void* NativeMenu; typedef void* NativeViewAccessible; #elif defined(OS_ANDROID) |