about summary refs log tree commit diff
path: root/nixpkgs/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
blob: de75ecbd0c17c85eb35ebd8fbc2832ecee488324 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From f156c35975e7844d2369ec5a6633ee40ec56f17a Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Mon, 7 Dec 2020 12:32:29 -0500
Subject: [PATCH 1/6] Revert "QCocoaDrag - set image only on the first drag
 item"

This reverts commit 7ee9bfc158a290776f622f62d0202220c6d159bc.
---
 src/plugins/platforms/cocoa/qcocoadrag.mm | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
index 4bd1b129bd..a506126c72 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -217,18 +217,13 @@ bool QCocoaDrag::maybeDragMultipleItems()
     // 0. We start from URLs, which can be actually in a list (thus technically
     // only ONE item in the pasteboard. The fact it's only one does not help, we are
     // still getting an exception because of the number of items/images mismatch ...
-    // We only set the image for the first item and nil for the rest, the image already
-    // contains a combined picture for all urls we drag.
-    auto imageOrNil = dragImage;
     for (const auto &qtUrl : qtUrls) {
         NSURL *nsUrl = qtUrl.toNSURL();
         auto *newItem = [[[NSDraggingItem alloc] initWithPasteboardWriter:nsUrl] autorelease];
         const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
                                             dragImage.size.width,
                                             dragImage.size.height);
-
-        [newItem setDraggingFrame:itemFrame contents:imageOrNil];
-        imageOrNil = nil;
+        [newItem setDraggingFrame:itemFrame contents:dragImage];
         [dragItems addObject:newItem];
     }
     // 1. Repeat for non-url items, if any:
@@ -237,7 +232,7 @@ bool QCocoaDrag::maybeDragMultipleItems()
         const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
                                             dragImage.size.width,
                                             dragImage.size.height);
-        [newItem setDraggingFrame:itemFrame contents:imageOrNil];
+        [newItem setDraggingFrame:itemFrame contents:dragImage];
         [dragItems addObject:newItem];
     }
 
-- 
2.21.0