From b55eedab263da63c025e581073caeda9dc0c02ab Mon Sep 17 00:00:00 2001 From: spang Date: Wed, 3 Dec 2014 10:24:49 -0800 Subject: [PATCH] ozone: dri: Fix cursor starting at 0,0 instead of display center Ash is warping the cursor to 0,0 in PostDisplayConfigurationChange because that's where it thinks the cursor is supposed to be. We're not reporting a mouse move for the initial placement, but need to so that ash can restore state after config changes. BUG=438432 TEST=manual on link_freon Review URL: https://codereview.chromium.org/774733003 Cr-Commit-Position: refs/heads/master@{#306631} --- ui/ozone/platform/dri/dri_window_manager.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/ozone/platform/dri/dri_window_manager.cc b/ui/ozone/platform/dri/dri_window_manager.cc index 8bae641227a4..740c7928150f 100644 --- a/ui/ozone/platform/dri/dri_window_manager.cc +++ b/ui/ozone/platform/dri/dri_window_manager.cc @@ -12,9 +12,9 @@ namespace ui { namespace { -gfx::PointF GetDefaultCursorLocation(DriWindow* window) { - return gfx::PointF(window->GetBounds().width() / 2, - window->GetBounds().height() / 2); +gfx::Point GetDefaultCursorLocation(DriWindow* window) { + return gfx::Point(window->GetBounds().width() / 2, + window->GetBounds().height() / 2); } } // namespace @@ -83,9 +83,9 @@ void DriWindowManager::ResetCursorLocation() { } WidgetToWindowMap::iterator it = window_map_.begin(); - gfx::AcceleratedWidget cursor_widget = it->first; - gfx::PointF location = GetDefaultCursorLocation(it->second); - cursor_->MoveCursorTo(cursor_widget, location); + DriWindow* cursor_window = it->second; + gfx::Point location = GetDefaultCursorLocation(cursor_window); + cursor_window->MoveCursorTo(location); } void DriWindowManager::GrabEvents(gfx::AcceleratedWidget widget) { -- 2.11.4.GIT