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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 25336003: Use root window's coordinates when updating cursor in Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win-specific hack removed Created 7 years 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
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index dddc7b639b5c44ba404c6cb11d634b56bdd9bbf5..013d4aa9b222638b9136806ad6cc01f46e9a0856 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -3268,20 +3268,15 @@ void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() {
if (!root_window)
return;
- gfx::Rect screen_rect = GetViewBounds();
- gfx::Point local_point = screen_point;
- local_point.Offset(-screen_rect.x(), -screen_rect.y());
+ gfx::Point root_window_point = screen_point;
+ aura::client::ScreenPositionClient* screen_position_client =
+ aura::client::GetScreenPositionClient(root_window);
+ if (screen_position_client) {
+ screen_position_client->ConvertPointFromScreen(
+ root_window, &root_window_point);
+ }
-#if defined(OS_WIN)
- // If there's another toplevel window above us at this point (for example a
- // menu), we don't want to update the cursor.
- POINT windows_point = { screen_point.x(), screen_point.y() };
- aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
- if (dispatcher->host()->GetAcceleratedWidget() !=
- ::WindowFromPoint(windows_point))
- return;
-#endif
- if (root_window->GetEventHandlerForPoint(local_point) != window_)
+ if (root_window->GetEventHandlerForPoint(root_window_point) != window_)
return;
gfx::NativeCursor cursor = current_cursor_.GetNativeCursor();

Powered by Google App Engine
This is Rietveld 408576698