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) |