Skip to content

[Backport to GNOME 41] wayland/xdnd: Use multiple DnD X11 peers

When a drag and drop occurs from an X11 client to a Wayland native client, mutter uses an internal X11 window as a peer for the DnD drop site.

That internal X11 window is moved and resized to match the Wayland native windows as the drag destination moves.

When moving from one Wayland native window to another Wayland native window, the same X11 window is used, and as a result no DND enter/leave events is emitted.

In that case, the drop may occur on the wrong Wayland native window, because no new XdndEnter/XdndLeave event were emitted.

To avoid that issue, use a pair of X11 windows instead of just one and alternate between the two when repicking a new drop surface, so that moving from a Wayland surface to another will always generate the expected enter/leave events that we rely on.

Closes: #2136 (closed) Part-of: !2305 (merged) (cherry picked from commit fe41e69e)

Merge request reports