| Index: ui/aura/root_window.cc
|
| diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
|
| index 4af5464b43db93f6d3b62347309ef64674b9e2e5..3b36d693430ba37e4c539fe2c7a171f6c2edaeb1 100644
|
| --- a/ui/aura/root_window.cc
|
| +++ b/ui/aura/root_window.cc
|
| @@ -124,9 +124,6 @@ RootWindow::RootWindow(const CreateParams& params)
|
| mouse_button_flags_(0),
|
| touch_ids_down_(0),
|
| last_cursor_(ui::kCursorNull),
|
| - // TODO(ivankr): this currently tracks the default state in
|
| - // RootWindowHostLinux. Other platforms do not implement ShowCursor().
|
| - cursor_shown_(true),
|
| mouse_pressed_handler_(NULL),
|
| mouse_moved_handler_(NULL),
|
| mouse_event_dispatch_target_(NULL),
|
| @@ -249,15 +246,11 @@ void RootWindow::SetCursor(gfx::NativeCursor cursor) {
|
| host_->SetCursor(cursor);
|
| }
|
|
|
| -void RootWindow::ShowCursor(bool show) {
|
| +void RootWindow::OnCursorVisibilityChanged(bool show) {
|
| // Send entered / exited so that visual state can be updated to match
|
| // cursor state.
|
| - if (show != cursor_shown_) {
|
| - cursor_shown_ = show;
|
| - host_->ShowCursor(show);
|
| - Env::GetInstance()->SetCursorShown(show);
|
| - PostMouseMoveEventAfterWindowChange();
|
| - }
|
| + Env::GetInstance()->SetCursorShown(show);
|
| + PostMouseMoveEventAfterWindowChange();
|
| }
|
|
|
| void RootWindow::MoveCursorTo(const gfx::Point& location_in_dip) {
|
| @@ -530,19 +523,23 @@ void RootWindow::OnDeviceScaleFactorChanged(
|
| float device_scale_factor) {
|
| const bool cursor_is_in_bounds =
|
| GetBoundsInScreen().Contains(Env::GetInstance()->last_mouse_location());
|
| - if (cursor_is_in_bounds && cursor_shown_)
|
| - ShowCursor(false);
|
| + bool cursor_visible = false;
|
| + client::CursorClient* cursor_client = client::GetCursorClient(this);
|
| + if (cursor_is_in_bounds && cursor_client) {
|
| + cursor_visible = cursor_client->IsCursorVisible();
|
| + if (cursor_visible)
|
| + cursor_client->ShowCursor(false);
|
| + }
|
| host_->OnDeviceScaleFactorChanged(device_scale_factor);
|
| Window::OnDeviceScaleFactorChanged(device_scale_factor);
|
| // Update the device scale factor of the cursor client only when the last
|
| // mouse location is on this root window.
|
| if (cursor_is_in_bounds) {
|
| - client::CursorClient* cursor_client = client::GetCursorClient(this);
|
| if (cursor_client)
|
| cursor_client->SetDeviceScaleFactor(device_scale_factor);
|
| }
|
| - if (cursor_is_in_bounds && cursor_shown_)
|
| - ShowCursor(true);
|
| + if (cursor_is_in_bounds && cursor_client && cursor_visible)
|
| + cursor_client->ShowCursor(true);
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|