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

Unified Diff: chrome/browser/ui/views/tabs/tab_drag_controller.cc

Issue 2410773002: Linux Aura: Use managed tab dragging when possible (Reland)
Patch Set: use POST_DISPATCH_NONE Created 4 years, 2 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 | « no previous file | ui/base/x/x11_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_drag_controller.cc
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
index 605f476d6ac5a190f73ebede31ccb3a6e99f0e4d..db542697607e4e7110ec9d9290a0b2e86e658bf0 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -379,6 +379,7 @@ void TabDragController::Drag(const gfx::Point& point_in_screen) {
}
started_drag_ = true;
Attach(source_tabstrip_, gfx::Point());
+ gfx::Point drag_point_in_screen = point_in_screen;
if (static_cast<int>(drag_data_.size()) ==
GetModel(source_tabstrip_)->count()) {
if (was_source_maximized_ || was_source_fullscreen_) {
@@ -403,6 +404,7 @@ void TabDragController::Drag(const gfx::Point& point_in_screen) {
&drag_bounds);
widget->SetVisibilityChangedAnimationsEnabled(true);
} else {
+#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
// The user has to move the mouse some amount of pixels before the drag
// starts. Offset the window by this amount so that the relative offset
// of the initial location is consistent. See crbug.com/518740
@@ -411,8 +413,14 @@ void TabDragController::Drag(const gfx::Point& point_in_screen) {
bounds.Offset(point_in_screen.x() - start_point_in_screen_.x(),
point_in_screen.y() - start_point_in_screen_.y());
widget->SetBounds(bounds);
+#else
+ // Linux does not need the window offset behavior above because all drag
+ // implementations move windows relative to a passed-in cursor position
+ // instead of the implicit current cursor position like on Windows.
+ drag_point_in_screen = start_point_in_screen_;
+#endif
}
- RunMoveLoop(GetWindowOffset(point_in_screen));
+ RunMoveLoop(GetWindowOffset(drag_point_in_screen));
return;
}
}
« no previous file with comments | « no previous file | ui/base/x/x11_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698