linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / qt-5 / 5.15 / qtbase.patch.d / macos-sdk-10.12 / 0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch
blobde75ecbd0c17c85eb35ebd8fbc2832ecee488324
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
5 item"
7 This reverts commit 7ee9bfc158a290776f622f62d0202220c6d159bc.
8 ---
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,
27 dragImage.size.width,
28 dragImage.size.height);
30 - [newItem setDraggingFrame:itemFrame contents:imageOrNil];
31 - imageOrNil = nil;
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,
38 dragImage.size.width,
39 dragImage.size.height);
40 - [newItem setDraggingFrame:itemFrame contents:imageOrNil];
41 + [newItem setDraggingFrame:itemFrame contents:dragImage];
42 [dragItems addObject:newItem];
45 --
46 2.21.0