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

Unified Diff: ui/ozone/platform/dri/dri_cursor.cc

Issue 657603002: ash: ozone: apply transformation to events outside the root window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on ToT Created 6 years, 1 month 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: ui/ozone/platform/dri/dri_cursor.cc
diff --git a/ui/ozone/platform/dri/dri_cursor.cc b/ui/ozone/platform/dri/dri_cursor.cc
index 22d21726136cf157c911b694c3904ff3dc38e195..fb8581190676b25ca9b4630dcc4126a1c5a8ef67 100644
--- a/ui/ozone/platform/dri/dri_cursor.cc
+++ b/ui/ozone/platform/dri/dri_cursor.cc
@@ -58,16 +58,20 @@ void DriCursor::MoveCursorTo(gfx::AcceleratedWidget widget,
cursor_window_ = widget;
cursor_location_ = location;
+ cursor_root_location_ = location;
if (cursor_window_ == gfx::kNullAcceleratedWidget)
return;
DriWindow* window = window_manager_->GetWindow(cursor_window_);
- const gfx::Size& size = window->GetBounds().size();
+ gfx::Rect bounds = window->GetBounds();
+ const gfx::Size& size = bounds.size();
cursor_location_.SetToMax(gfx::PointF(0, 0));
// Right and bottom edges are exclusive.
cursor_location_.SetToMin(gfx::PointF(size.width() - 1, size.height() - 1));
+ cursor_root_location_.Offset(bounds.origin().x(), bounds.origin().y());
spang 2014/11/10 20:30:47 I noticed a bug. This is using the original locati
llandwerlin-old 2014/11/11 11:03:53 Done.
+
if (cursor_.get())
hardware_->MoveHardwareCursor(cursor_window_, bitmap_location());
}
@@ -88,6 +92,10 @@ gfx::PointF DriCursor::location() {
return cursor_location_;
}
+gfx::PointF DriCursor::root_location() {
+ return cursor_root_location_;
+}
+
gfx::Point DriCursor::bitmap_location() {
return gfx::ToFlooredPoint(cursor_location_) -
cursor_->hotspot().OffsetFromOrigin();

Powered by Google App Engine
This is Rietveld 408576698