summaryrefslogtreecommitdiffstats
path: root/ui/aura/env.cc
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-15 16:49:48 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-15 16:49:48 +0000
commit3e0a722db6721091c46f9b328223dee8dbcc04b6 (patch)
tree5f2f115e33cd8af847edb6b82b0d384d8a7d8f6c /ui/aura/env.cc
parent9b655538c53730dfd92c4a76eb991bb99ff59ae8 (diff)
downloadchromium_src-3e0a722db6721091c46f9b328223dee8dbcc04b6.zip
chromium_src-3e0a722db6721091c46f9b328223dee8dbcc04b6.tar.gz
chromium_src-3e0a722db6721091c46f9b328223dee8dbcc04b6.tar.bz2
Move cursor when it's hidden so that UX can update correctly
BUG=136057 TEST=None Review URL: https://chromiumcodereview.appspot.com/10829180 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/env.cc')
-rw-r--r--ui/aura/env.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index b00dd89..90f3fbf 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);
+ is_cursor_hidden_ = true;
+ }
+}
+
void Env::SetDisplayManager(DisplayManager* display_manager) {
display_manager_.reset(display_manager);
#if defined(USE_X11)