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

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

Issue 1456963002: Make browser windows override_redirect when dragging tabs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make browser windows override_redirect when dragging tabs. Created 4 years, 11 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 e604c7c47692ca25ace806a1355c3f0626e444db..e79cb88dd04cdd99f029bc501959ae3eb704e914 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -29,6 +29,7 @@
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_function_dispatcher.h"
+#include "ui/aura/window_tree_host.h"
#include "ui/events/event_constants.h"
#include "ui/events/gestures/gesture_recognizer.h"
#include "ui/gfx/geometry/point_conversions.h"
@@ -1498,6 +1499,10 @@ void TabDragController::RevertDragAt(size_t drag_index) {
void TabDragController::CompleteDrag() {
DCHECK(started_drag_);
+ // Remap the window without override-redirect, so that the window manager will
+ // pick it up (we use an unmanaged window while dragging).
+ GetAttachedBrowserWidget()->GetNativeView()->GetHost()->RemapAsNormalWindow();
+
if (attached_tabstrip_) {
if (is_dragging_new_browser_ || did_restore_window_) {
if (IsDockedOrSnapped(attached_tabstrip_)) {
@@ -1750,6 +1755,7 @@ Browser* TabDragController::CreateBrowserForDrag(
profile,
host_desktop_type_);
create_params.initial_bounds = new_bounds;
+ create_params.is_being_dragged = true;
Browser* browser = new Browser(create_params);
is_dragging_new_browser_ = true;
SetWindowPositionManaged(browser->window()->GetNativeWindow(), false);

Powered by Google App Engine
This is Rietveld 408576698