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

Unified Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 10948020: Convert native mouse locations to the locations in screen coordinate in RootWindowHostLinux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 | « ash/wm/workspace/workspace_window_resizer.h ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_window_resizer.cc
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index e38113488934ca1d38925a631ba844e03bda44de..c8e0075669dd6256504d0cfb0e216abefeb1fbd5 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -122,23 +122,10 @@ WorkspaceWindowResizer* WorkspaceWindowResizer::Create(
new WorkspaceWindowResizer(details, attached_windows) : NULL;
}
-void WorkspaceWindowResizer::Drag(const gfx::Point& location, int event_flags) {
- std::pair<aura::RootWindow*, gfx::Point> actual_location =
- wm::GetRootWindowRelativeToWindow(window()->parent(), location);
- aura::RootWindow* current_root = actual_location.first;
- gfx::Point location_in_parent = actual_location.second;
- aura::Window::ConvertPointToTarget(current_root,
- window()->parent(),
- &location_in_parent);
+void WorkspaceWindowResizer::Drag(const gfx::Point& location_in_parent,
+ int event_flags) {
last_mouse_location_ = location_in_parent;
- // Do not use |location| below this point, use |location_in_parent| instead.
- // When the pointer is on |window()->GetRootWindow()|, |location| and
- // |location_in_parent| have the same value and both of them are in
- // |window()->parent()|'s coordinates, but once the pointer enters the
- // other root window, you will see an unexpected value on the former. See
- // comments in wm::GetRootWindowRelativeToWindow() for details.
-
int grid_size = event_flags & ui::EF_CONTROL_DOWN ? 0 : kScreenEdgeInset;
gfx::Rect bounds = // in |window()->parent()|'s coordinates.
CalculateBoundsForDrag(details_, location_in_parent);
@@ -155,7 +142,10 @@ void WorkspaceWindowResizer::Drag(const gfx::Point& location, int event_flags) {
did_move_or_resize_ = true;
}
- const bool in_original_root = (window()->GetRootWindow() == current_root);
+ gfx::Point location_in_screen = location_in_parent;
+ wm::ConvertPointToScreen(window()->parent(), &location_in_screen);
+ const bool in_original_root =
+ wm::GetRootWindowAt(location_in_screen) == window()->GetRootWindow();
// Hide a phantom window for snapping if the cursor is in another root window.
if (in_original_root) {
UpdateSnapPhantomWindow(location_in_parent, bounds);
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.h ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698