Commit d75523ca authored by Nick Diego Yamane's avatar Nick Diego Yamane Committed by Commit Bot

exo: extended-drag: Disable show/hide animations for the dragged window

Context: Wayland Protocol needs to be extended to make it possible to
properly support full Chromium's tab dragging experience. Further
details in the Design document [1].

This is a follow-up change, that implements the animation disabling for
the dragged window when there is extended-drag source attached to the
active DnD wl_data_source.

[1] https://docs.google.com/document/d/1s6OwTi_WC-pS21WLGQYI39yw2m42ZlVolUXBclljXB4/edit?usp=sharing

R=oshima@chromium.org

Bug: 1099418
Test: Manually tested.
Change-Id: Ib16842e4d5ca1e5a1f24313ddaddbe3373cfbc3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411159
Commit-Queue: Nick Yamane <nickdiego@igalia.com>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822696}
parent 1d0c441d
......@@ -15,6 +15,7 @@
#include "base/optional.h"
#include "components/exo/data_source.h"
#include "components/exo/surface.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window_observer.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/mojom/drag_drop_types.mojom-shared.h"
......@@ -221,6 +222,9 @@ void ExtendedDragSource::StartDrag(aura::Window* toplevel,
event_blocker_ =
std::make_unique<aura::ScopedWindowEventTargetingBlocker>(toplevel);
// Disable visibility change animations on the dragged window.
toplevel->SetProperty(aura::client::kAnimationsDisabledKey, true);
DVLOG(1) << "Starting drag. pointer_loc=" << pointer_location.ToString();
auto* toplevel_handler = ash::Shell::Get()->toplevel_window_event_handler();
auto move_source = drag_event_source_ == ui::mojom::DragEventSource::kTouch
......@@ -266,6 +270,10 @@ gfx::Point ExtendedDragSource::CalculateOrigin(aura::Window* target) const {
}
void ExtendedDragSource::Cleanup() {
if (dragged_window_holder_ && dragged_window_holder_->toplevel_window()) {
dragged_window_holder_->toplevel_window()->ClearProperty(
aura::client::kAnimationsDisabledKey);
}
event_blocker_.reset();
dragged_window_holder_.reset();
UnlockCursor();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment