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

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: do not move modal windows to another display Created 8 years, 5 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..16f4db395f62477e8de40783bc9c55ebfd3ead69 100644
--- a/ash/wm/default_window_resizer.cc
+++ b/ash/wm/default_window_resizer.cc
@@ -7,6 +7,7 @@
#include "ash/shell.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"
@@ -32,10 +33,21 @@ DefaultWindowResizer::Create(aura::Window* window,
return details.is_resizable ? new DefaultWindowResizer(details) : NULL;
}
-void DefaultWindowResizer::Drag(const gfx::Point& location, int event_flags) {
+void DefaultWindowResizer::Drag(const gfx::Point& location_in_screen,
+ int event_flags) {
+ // TODO(mazda|yusukes): Implement dragging an item from one display to another
+ aura::RootWindow* current_root = Shell::GetRootWindowAt(location_in_screen);
+ if (current_root != details_.window->GetRootWindow())
+ return;
+
+ gfx::Point location_in_root = location_in_screen;
+ 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));
if (bounds != details_.window->bounds()) {
did_move_or_resize_ = true;
details_.window->SetBounds(bounds);

Powered by Google App Engine
This is Rietveld 408576698