1 From f156c35975e7844d2369ec5a6633ee40ec56f17a Mon Sep 17 00:00:00 2001
2 From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
3 Date: Mon, 7 Dec 2020 12:32:29 -0500
4 Subject: [PATCH 1/6] Revert "QCocoaDrag - set image only on the first drag
7 This reverts commit 7ee9bfc158a290776f622f62d0202220c6d159bc.
9 src/plugins/platforms/cocoa/qcocoadrag.mm | 9 ++-------
10 1 file changed, 2 insertions(+), 7 deletions(-)
12 diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
13 index 4bd1b129bd..a506126c72 100644
14 --- a/src/plugins/platforms/cocoa/qcocoadrag.mm
15 +++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
16 @@ -217,18 +217,13 @@ bool QCocoaDrag::maybeDragMultipleItems()
17 // 0. We start from URLs, which can be actually in a list (thus technically
18 // only ONE item in the pasteboard. The fact it's only one does not help, we are
19 // still getting an exception because of the number of items/images mismatch ...
20 - // We only set the image for the first item and nil for the rest, the image already
21 - // contains a combined picture for all urls we drag.
22 - auto imageOrNil = dragImage;
23 for (const auto &qtUrl : qtUrls) {
24 NSURL *nsUrl = qtUrl.toNSURL();
25 auto *newItem = [[[NSDraggingItem alloc] initWithPasteboardWriter:nsUrl] autorelease];
26 const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
28 dragImage.size.height);
30 - [newItem setDraggingFrame:itemFrame contents:imageOrNil];
32 + [newItem setDraggingFrame:itemFrame contents:dragImage];
33 [dragItems addObject:newItem];
35 // 1. Repeat for non-url items, if any:
36 @@ -237,7 +232,7 @@ bool QCocoaDrag::maybeDragMultipleItems()
37 const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
39 dragImage.size.height);
40 - [newItem setDraggingFrame:itemFrame contents:imageOrNil];
41 + [newItem setDraggingFrame:itemFrame contents:dragImage];
42 [dragItems addObject:newItem];