Commit 2bbe8a52 authored by Nick Diego Yamane's avatar Nick Diego Yamane Committed by Commit Bot

ozone/wayland: tabdrag: Switch to null drag icon surface

Now that SwayWM supports null drag icon surfaces to be passed when
starting DND sessions [1], we can safely use it instead of allocating a
surface with no buffer attached, which is currently not supported by
Exosphere [2].

A non-null drag icon surface will be used in the future, once (at least)
Exo supports the protocol extensions being proposed at the tab dragging
design document [3]. This does not cause any functional change.

The aforementioned Sway fix is available for now only in upstream
development branch. It is expected to be included in releases >= 1.5.

[1] https://github.com/swaywm/sway/issues/5509
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=1102926
[3] https://docs.google.com/document/d/1s6OwTi_WC-pS21WLGQYI39yw2m42ZlVolUXBclljXB4/edit?usp=sharing

R=tonikitoo@igalia.com

Bug: 896640
Change-Id: Ic00b960c44c67a2311282b5b46a7cac752a773e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2284981
Commit-Queue: Nick Yamane <nickdiego@igalia.com>
Reviewed-by: default avatarAntonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#786013}
parent 5cc98833
...@@ -194,7 +194,6 @@ void WaylandWindowDragController::OnDataSourceFinish(bool completed) { ...@@ -194,7 +194,6 @@ void WaylandWindowDragController::OnDataSourceFinish(bool completed) {
// Release DND objects. // Release DND objects.
data_offer_.reset(); data_offer_.reset();
data_source_.reset(); data_source_.reset();
icon_surface_.reset();
origin_surface_.reset(); origin_surface_.reset();
origin_window_ = nullptr; origin_window_ = nullptr;
dragged_window_ = nullptr; dragged_window_ = nullptr;
...@@ -255,9 +254,6 @@ bool WaylandWindowDragController::OfferWindow() { ...@@ -255,9 +254,6 @@ bool WaylandWindowDragController::OfferWindow() {
data_source_ = data_device_manager_->CreateSource(this); data_source_ = data_device_manager_->CreateSource(this);
if (state_ == State::kIdle) { if (state_ == State::kIdle) {
DCHECK(!icon_surface_);
icon_surface_ = connection_->CreateSurface();
// Observe window so we can take ownership of the origin surface in case it // Observe window so we can take ownership of the origin surface in case it
// is destroyed during the DND session. // is destroyed during the DND session.
window_manager_->AddObserver(this); window_manager_->AddObserver(this);
...@@ -266,8 +262,11 @@ bool WaylandWindowDragController::OfferWindow() { ...@@ -266,8 +262,11 @@ bool WaylandWindowDragController::OfferWindow() {
state_ = State::kAttached; state_ = State::kAttached;
data_source_->Offer({kMimeTypeChromiumWindow}); data_source_->Offer({kMimeTypeChromiumWindow});
data_source_->SetAction(DragDropTypes::DRAG_MOVE); data_source_->SetAction(DragDropTypes::DRAG_MOVE);
data_device_->StartDrag(*data_source_, *origin_window_, icon_surface_.get(),
this); // TODO(crbug.com/1099418): Use dragged window's surface as icon surface
// once "immediate drag" protocol extensions are available.
data_device_->StartDrag(*data_source_, *origin_window_,
/*icon_surface=*/nullptr, this);
} }
pointer_grab_owner_ = origin_window_; pointer_grab_owner_ = origin_window_;
......
...@@ -113,7 +113,6 @@ class WaylandWindowDragController : public WaylandDataDevice::DragDelegate, ...@@ -113,7 +113,6 @@ class WaylandWindowDragController : public WaylandDataDevice::DragDelegate,
std::unique_ptr<WaylandDataSource> data_source_; std::unique_ptr<WaylandDataSource> data_source_;
std::unique_ptr<WaylandDataOffer> data_offer_; std::unique_ptr<WaylandDataOffer> data_offer_;
wl::Object<wl_surface> icon_surface_;
// The current toplevel window being dragged, when in detached mode. // The current toplevel window being dragged, when in detached mode.
WaylandToplevelWindow* dragged_window_ = nullptr; WaylandToplevelWindow* dragged_window_ = nullptr;
......
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