Skip to content
Commit 06ea2cf7 authored by Emmanuele Bassi's avatar Emmanuele Bassi 👣
Browse files

drag-action: Ensure that we can destroy the drag handle

If the DragAction has a drag handle that gets destroyed inside the
::drag-end signal handler, the destruction sequence will trigger a
callback we have in place to check if the handle is being destroyed
mid-drag, e.g. from a ::drag-motion event.

The callback on the drag handle destruction will check if we are still
in the middle of a drag and emit the ::drag-end signal to allow cleaning
up; the callback erroneously uses the drag handle as the argument for
the emit_drag_end() function — instead of the actor to which the drag
action has been attached. Also, by the time we emit the ::drag-end, we
are not dragging the actor any more, so we shouldn't be emitted the
::drag-end signal twice.

The fix is, thus, made of two parts:

  - reset the in_drag boolean before emitting the ::drag-end signal
    so that destroying the drag handle will not result in a double
    signal emission;

  - use the correct actor when calling emit_drag_end().

https://bugzilla.gnome.org/show_bug.cgi?id=681814
parent 449dca80
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