summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsaintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-23 01:20:28 +0000
committersaintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-23 01:20:28 +0000
commit7785b17f588fb9d8b583f3a38db0bc40f414cc3d (patch)
tree1fdfc15f13785caccd4f539a12166837f4a419a4 /views
parent7f61719b8bd09b51204d63da92ebbec1d22b3e12 (diff)
downloadchromium_src-7785b17f588fb9d8b583f3a38db0bc40f414cc3d.zip
chromium_src-7785b17f588fb9d8b583f3a38db0bc40f414cc3d.tar.gz
chromium_src-7785b17f588fb9d8b583f3a38db0bc40f414cc3d.tar.bz2
Fix for issue =76919 and added --keep-mouse-cursor (76976)
(note this is a resubmit of Issue 6718004) BUG=76919, 76976 TEST=none Review URL: http://codereview.chromium.org/6716024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79086 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/root_view.cc14
-rw-r--r--views/widget/root_view.h5
-rw-r--r--views/widget/widget_gtk.cc4
3 files changed, 22 insertions, 1 deletions
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc
index f5ceffe..dc6cc67 100644
--- a/views/widget/root_view.cc
+++ b/views/widget/root_view.cc
@@ -397,6 +397,20 @@ void RootView::GetAccessibleState(ui::AccessibleViewState* state) {
state->role = ui::AccessibilityTypes::ROLE_APPLICATION;
}
+#if defined(TOUCH_UI)
+// Always show the mouse cursor, useful when debugging touch builds
+static bool keep_mouse_cursor_;
+
+void RootView::SetKeepMouseCursor(bool keep) {
+ keep_mouse_cursor_ = keep;
+}
+
+bool RootView::GetKeepMouseCursor() {
+ return keep_mouse_cursor_;
+}
+
+#endif
+
////////////////////////////////////////////////////////////////////////////////
// RootView, protected:
diff --git a/views/widget/root_view.h b/views/widget/root_view.h
index b6f7662..68433b0 100644
--- a/views/widget/root_view.h
+++ b/views/widget/root_view.h
@@ -116,6 +116,11 @@ class RootView : public View,
virtual void SetMouseHandler(View* new_mouse_handler) OVERRIDE;
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
+#if defined(TOUCH_UI)
+ static void SetKeepMouseCursor(bool keep);
+ static bool GetKeepMouseCursor();
+#endif
+
protected:
// Overridden from View:
virtual void ViewHierarchyChanged(bool is_add, View* parent,
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index 5f470c5..7f256c2 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -917,7 +917,9 @@ void WidgetGtk::SchedulePaintInRect(const gfx::Rect& rect) {
void WidgetGtk::SetCursor(gfx::NativeCursor cursor) {
#if defined(TOUCH_UI) && defined(HAVE_XINPUT2)
- if (!TouchFactory::GetInstance()->is_cursor_visible())
+ if (RootView::GetKeepMouseCursor())
+ cursor = gfx::GetCursor(GDK_ARROW);
+ else if (!TouchFactory::GetInstance()->is_cursor_visible())
cursor = gfx::GetCursor(GDK_BLANK_CURSOR);
#endif
// |window_contents_| is placed on top of |widget_|. So the cursor needs to be