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

Unified Diff: ash/wm/default_window_resizer.cc

Issue 10835047: Allow the cursor to warp even when a window is dragged (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 4 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
Index: ash/wm/default_window_resizer.cc
diff --git a/ash/wm/default_window_resizer.cc b/ash/wm/default_window_resizer.cc
index 4368c73b88ba14b3230441fe40d1b8a83ebc0d22..8aa50a5dc4466a172d2783152f11e5cd5b03ea19 100644
--- a/ash/wm/default_window_resizer.cc
+++ b/ash/wm/default_window_resizer.cc
@@ -5,8 +5,10 @@
#include "ash/wm/default_window_resizer.h"
#include "ash/shell.h"
+#include "ash/wm/coordinate_conversion.h"
#include "ash/wm/cursor_manager.h"
#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
@@ -33,9 +35,26 @@ DefaultWindowResizer::Create(aura::Window* window,
}
void DefaultWindowResizer::Drag(const gfx::Point& location, int event_flags) {
+ std::pair<aura::RootWindow*, gfx::Point> actual_location =
+ wm::GetRootWindowRelativeToWindow(details_.window->parent(), location);
+
+ aura::RootWindow* current_root = actual_location.first;
+ gfx::Point location_in_root = actual_location.second;
+ gfx::Point location_in_screen = actual_location.second;
+ aura::client::GetScreenPositionClient(current_root)->
+ ConvertPointToScreen(current_root, &location_in_screen);
sky 2012/08/03 17:07:18 This is too much code for something that seems lik
Yusuke Sato 2012/08/03 23:18:45 Done.
+
+ // TODO(mazda|yusukes): Implement dragging an item from one display to another
+ if (current_root != details_.window->GetRootWindow())
+ return;
+
+ aura::client::GetScreenPositionClient(current_root)->
+ ConvertPointFromScreen(current_root, &location_in_root);
+
int grid_size = event_flags & ui::EF_CONTROL_DOWN ?
0 : ash::Shell::GetInstance()->GetGridSize();
- gfx::Rect bounds(CalculateBoundsForDrag(details_, location, grid_size));
+ gfx::Rect bounds(
+ CalculateBoundsForDrag(details_, location_in_root, grid_size));
sky 2012/08/03 17:07:18 Why does this need to change?
Yusuke Sato 2012/08/03 23:18:45 Reverted.
if (bounds != details_.window->bounds()) {
did_move_or_resize_ = true;
details_.window->SetBounds(bounds);

Powered by Google App Engine
This is Rietveld 408576698