summaryrefslogtreecommitdiffstats
path: root/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
diff options
context:
space:
mode:
Diffstat (limited to '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')
-rw-r--r--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.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/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 b/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
new file mode 100644
index 000000000000..de75ecbd0c17
--- /dev/null
+++ b/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
@@ -0,0 +1,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
+