Skip to content

Fix picking drag target

Vlad Zahorodnii requested to merge work/cherry-pick-7dbb06d8 into Plasma/5.27

The normal stacking order contains managed and unmanaged windows now. This kind of breaks dragging from X11 to Wayland clients.

When an X11 client is the drag source, it's going to create an override redirect window for the drag icon, which is beneath the pointer.

findManagedToplevel() will return the drag icon instead of the window beneath the drag icon.

The root problem is that normal event processing has different needs. It doesn't care about window type except when the screen is locked, while dnd does. Perhaps it also makes sense to check whether the window accepts focus.

This change introduces a specialized helper to pick the drag target. Unfortunately, it amounts to some code duplication. On the other hand, not sure that other options (such as adding flags to findToplevel()) are better.

(cherry picked from commit 7dbb06d8)

Merge request reports

Loading