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

Unified Diff: ui/aura/env.cc

Issue 10829180: Move cursor when it's hidden so that UX can update correctly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable test for windows Created 8 years, 4 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
« no previous file with comments | « ui/aura/env.h ('k') | ui/aura/root_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/env.cc
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index b00dd89a6b84095150c75649b599ca292c4dd9e0..90f3fbff4e20e2bfc4508d813d81ef9d32e25947 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -28,6 +28,7 @@ Env* Env::instance_ = NULL;
Env::Env()
: mouse_button_flags_(0),
+ is_cursor_hidden_(false),
is_touch_down_(false),
render_white_bg_(true),
stacking_client_(NULL) {
@@ -69,6 +70,19 @@ void Env::SetLastMouseLocation(const Window& window,
client->ConvertPointToScreen(&window, &last_mouse_location_);
}
+void Env::SetCursorShown(bool cursor_shown) {
+ if (cursor_shown) {
+ // Protect against restoring a position that hadn't been saved.
+ if (is_cursor_hidden_)
+ last_mouse_location_ = hidden_cursor_location_;
+ is_cursor_hidden_ = false;
+ } else {
+ hidden_cursor_location_ = last_mouse_location_;
+ last_mouse_location_ = gfx::Point(-10000, -10000);
sky 2012/08/14 16:01:00 Won't this cause all sorts of weirdness if the hid
+ is_cursor_hidden_ = true;
+ }
+}
+
void Env::SetDisplayManager(DisplayManager* display_manager) {
display_manager_.reset(display_manager);
#if defined(USE_X11)
« no previous file with comments | « ui/aura/env.h ('k') | ui/aura/root_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698