labwc / labwc

A Wayland window-stacking compositor

Home Page:https://labwc.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DND does not finish on desktop

tokyo4j opened this issue · comments

DND doesn't finish properly when the cursor button is released on desktop.

dnd-on-desktop.mp4

I confirmed removing the check for ctx.surface in cursor_button_release() (introduced in a252308) fixed the problem, though I don't know the purpose of this check.

diff --git a/src/input/cursor.c b/src/input/cursor.c
index eb359e7..4a9f6b9 100644
--- a/src/input/cursor.c
+++ b/src/input/cursor.c
@@ -1067,7 +1067,7 @@ cursor_button_release(struct seat *seat, uint32_t button,
        bool consumed_by_frame_context =
                handle_release_mousebinding(server, &ctx, button);
 
-       if (ctx.surface && !consumed_by_frame_context) {
+       if (!consumed_by_frame_context) {
                /* Notify client with pointer focus of button release */
                wlr_seat_pointer_notify_button(seat->seat, time_msec,
                        button, button_state);

Agree, that check doesn't appear to make sense for the cursor button release handler.

The commit linked is part of the original move to scene graph.
I assume what happened was that that condition is basically a copy from cursor_button_press() where the check likely makes sense.

CC @johanmalm just to ensure we don't miss any context here.

Nice find. The same issue can also be seen in firefox when dragging a tab out of firefox. Would be cool to have this addressed.

Agree, that check doesn't appear to make sense for the cursor button release handler.

The commit linked is part of the original move to scene graph. I assume what happened was that that condition is basically a copy from cursor_button_press() where the check likely makes sense.

CC @johanmalm just to ensure we don't miss any context here.

I'm fine with this patch. Can't think of why it's there either. Like you say - quite possibly cruft from pre-scene-graph.

I've tested with a few scenarios with scroll bars and selected text - but all seems fine.