From 5e380bdf30a0aa99e67738baad836b6a6486255f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 19 Dec 2025 23:35:46 +0100 Subject: [PATCH] clapper-app: Support list item D&D between different windows Handle drag and drop from the list in one player window to another --- src/bin/clapper-app/clapper-app-queue-list.c | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/bin/clapper-app/clapper-app-queue-list.c b/src/bin/clapper-app/clapper-app-queue-list.c index 5e0826b1..2c22f1f1 100644 --- a/src/bin/clapper-app/clapper-app-queue-list.c +++ b/src/bin/clapper-app/clapper-app-queue-list.c @@ -284,6 +284,27 @@ queue_drop_cb (GtkDropTarget *drop_target, const GValue *value, success = TRUE; } } + } else { // Drop from another window + GtkWidget *drop_widget = GTK_WIDGET (g_value_get_object (value)); + + if (G_LIKELY (CLAPPER_APP_IS_MEDIA_ITEM_BOX (drop_widget))) { + ClapperMediaItem *drop_item; + ClapperQueue *src_queue; + + drop_item = clapper_app_media_item_box_get_media_item ( + CLAPPER_APP_MEDIA_ITEM_BOX_CAST (drop_widget)); + + if ((src_queue = CLAPPER_QUEUE (gst_object_get_parent (GST_OBJECT (drop_item))))) { + gst_object_ref (drop_item); // Ref so it survives queue removal + + clapper_queue_remove_item (src_queue, drop_item); + clapper_queue_insert_item (queue, drop_item, drop_index); + success = TRUE; + + gst_object_unref (drop_item); // Unref after placed in new queue + gst_object_unref (src_queue); + } + } } } else { GFile **files = NULL;