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

Unified Diff: ui/wm/core/easy_resize_window_targeter.cc

Issue 180253006: Merge 252257 "events: Fix event-targeting for transformed windows." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1847/src/
Patch Set: Created 6 years, 10 months 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
« no previous file with comments | « ui/aura/window_targeter_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/easy_resize_window_targeter.cc
===================================================================
--- ui/wm/core/easy_resize_window_targeter.cc (revision 253296)
+++ ui/wm/core/easy_resize_window_targeter.cc (working copy)
@@ -27,18 +27,19 @@
aura::Window* window,
const ui::LocatedEvent& event) const {
if (ShouldUseExtendedBounds(window)) {
- gfx::RectF bounds(window->bounds());
- gfx::Transform transform = window->layer()->transform();
- transform.TransformRect(&bounds);
- if (event.IsTouchEvent() || event.IsGestureEvent()) {
+ // Note that |event|'s location is in |window|'s parent's coordinate system,
+ // so convert it to |window|'s coordinate system first.
+ gfx::Point point = event.location();
+ if (window->parent())
+ aura::Window::ConvertPointToTarget(window->parent(), window, &point);
+
+ gfx::Rect bounds(window->bounds().size());
+ if (event.IsTouchEvent() || event.IsGestureEvent())
bounds.Inset(touch_extend_);
- } else {
+ else
bounds.Inset(mouse_extend_);
- }
- // Note that |event|'s location is in the |container_|'s coordinate system,
- // as is |bounds|.
- return bounds.Contains(event.location());
+ return bounds.Contains(point);
}
return WindowTargeter::EventLocationInsideBounds(window, event);
}
« no previous file with comments | « ui/aura/window_targeter_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698