diff options
author | karen@chromium.org <karen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-24 20:49:05 +0000 |
---|---|---|
committer | karen@chromium.org <karen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-24 20:49:05 +0000 |
commit | 162348fb49c149375604be6ec26675da6376ee55 (patch) | |
tree | a041bdc3a52d25cf3e7b658dc8e2b5d18ffcde53 | |
parent | 653b5ece3b864b6adffd54dc8c0cc47e0325a063 (diff) | |
download | chromium_src-162348fb49c149375604be6ec26675da6376ee55.zip chromium_src-162348fb49c149375604be6ec26675da6376ee55.tar.gz chromium_src-162348fb49c149375604be6ec26675da6376ee55.tar.bz2 |
Merge 147450 - Changes tab dragging code back (on windows) to use cursor
position. Otherwise coordinates overflow and we do the wrong thing.
BUG=131628
TEST=see bug
R=ananta@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10808002
TBR=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10795096
git-svn-id: svn://svn.chromium.org/chrome/branches/1180/src@148191 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/views/tabs/tab_drag_controller.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc index 6d1f35d..460deca 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc @@ -434,6 +434,18 @@ bool TabDragController::IsActive() { } void TabDragController::Drag(const gfx::Point& screen_point) { +#if defined(OS_WIN) && !defined(USE_AURA) + // Windows coordinates are 16 bit values. When we hide the frame we move it to + // the max x/y coordinate. If the distance between the hidden frame and the + // current mouse coordinate is greater than 32k then the coordinate passed to + // the mouse handler wraps and we drag to the wrong place. For this reason we + // ignore the coordinates and use the actual cursor position. + // NOTE: this works for touch too as dragging with touch updates the mouse + // position. + gfx::Point real_screen_point(GetCursorScreenPoint()); +#else + gfx::Point real_screen_point(screen_point); +#endif bring_to_front_timer_.Stop(); move_stacked_timer_.Stop(); @@ -441,7 +453,7 @@ void TabDragController::Drag(const gfx::Point& screen_point) { return; if (!started_drag_) { - if (!CanStartDrag(screen_point)) + if (!CanStartDrag(real_screen_point)) return; // User hasn't dragged far enough yet. started_drag_ = true; @@ -454,7 +466,7 @@ void TabDragController::Drag(const gfx::Point& screen_point) { } } - ContinueDragging(screen_point); + ContinueDragging(real_screen_point); } void TabDragController::EndDrag(bool canceled) { |