From 2a59bfe9a059cd0b4a651afe7f95dd679c9ffc14 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 18 May 2026 13:08:49 +0530 Subject: [PATCH] Dont request the same MIME type multiple times --- kittens/dnd/drop.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kittens/dnd/drop.go b/kittens/dnd/drop.go index 854e86e7a..3ec8a9607 100644 --- a/kittens/dnd/drop.go +++ b/kittens/dnd/drop.go @@ -586,9 +586,11 @@ func (dnd *dnd) all_mime_data_dropped() (err error) { func (dnd *dnd) request_mime_data() { accepted := utils.NewSetWithItems(dnd.drop_status.accepted_mimes...) + seen := utils.NewSet[string](len(dnd.drop_status.accepted_mimes)) for idx, m := range dnd.drop_status.offered_mimes { - if accepted.Has(m) { + if accepted.Has(m) && !seen.Has(m) { dnd.queue_data_request(DC{Type: 'r', X: idx + 1}) + seen.Add(m) } } }