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

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

Issue 180983002: Avoids releasing capture prematurily when dragging tabs from one to another browser window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoids releasing capture prematurily when dragging tabs from one browser window to another Created 6 years, 10 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: 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 741a77fa8638741377a44a8b4dbde868e5839354..a2f456df427aa5f1d337723d93be823fed21578a 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -694,9 +694,12 @@ TabDragController::DragBrowserToNewTabStrip(
// that to effect the position of any windows.
SetWindowPositionManaged(browser_widget->GetNativeView(), false);
+#if !defined(OS_LINUX)
Elliot Glaysher 2014/02/26 20:33:17 Isn't this code used on chromeos, too?
varkha 2014/02/26 20:59:35 It is, but I did not see any visual impact from sk
// EndMoveLoop is going to snap the window back to its original location.
- // Hide it so users don't see this.
+ // Hide it so users don't see this. Hiding a window in Linux aura causes
+ // it to lose capture so skip it.
browser_widget->Hide();
varkha 2014/02/26 20:30:18 Not calling Hide on Linux seems to be lesser evil
+#endif
browser_widget->EndMoveLoop();
// Ideally we would always swap the tabs now, but on non-ash it seems that
@@ -1211,15 +1214,15 @@ void TabDragController::RunMoveLoop(const gfx::Vector2d& drag_offset) {
if (end_run_loop_behavior_ == END_RUN_LOOP_CONTINUE_DRAGGING) {
end_run_loop_behavior_ = END_RUN_LOOP_STOP_DRAGGING;
if (tab_strip_to_attach_to_after_exit_) {
+ tab_strip_to_attach_to_after_exit_->GetWidget()->Activate();
varkha 2014/02/26 20:30:18 Activating before calling Detach (which may close
Elliot Glaysher 2014/02/26 20:33:17 What's the effect on Windows here?
varkha 2014/02/26 20:59:35 I didn't have a chance to test this on Windows yet
+ // Activate may trigger a focus loss, destroying us.
+ if (!ref)
+ return;
gfx::Point point_in_screen(GetCursorScreenPoint());
Detach(DONT_RELEASE_CAPTURE);
Attach(tab_strip_to_attach_to_after_exit_, point_in_screen);
// Move the tabs into position.
MoveAttached(point_in_screen);
- attached_tabstrip_->GetWidget()->Activate();
- // Activate may trigger a focus loss, destroying us.
- if (!ref)
- return;
tab_strip_to_attach_to_after_exit_ = NULL;
}
DCHECK(attached_tabstrip_);

Powered by Google App Engine
This is Rietveld 408576698