From a1ade5e8426d9cccd3c59f692d6fab55e67021fa Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Thu, 11 Jun 2026 22:49:58 +0800
Subject: [PATCH] Add 7.9 app ordering support
---
src/Apptag/AppDragCoordinator.swift | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/src/Apptag/AppDragCoordinator.swift b/src/Apptag/AppDragCoordinator.swift
index 2dff55b..264706d 100644
--- a/src/Apptag/AppDragCoordinator.swift
+++ b/src/Apptag/AppDragCoordinator.swift
@@ -131,6 +131,7 @@
dragLayer.position = contentPoint
CATransaction.commit()
updateHoverTarget(at: screenPoint)
+ hoveredTarget?.appDragLocationChanged(screenPoint: screenPoint, copy: currentCopyMode)
return
}
@@ -144,6 +145,7 @@
)
dragWindow.setFrameOrigin(origin)
updateHoverTarget(at: screenPoint)
+ hoveredTarget?.appDragLocationChanged(screenPoint: screenPoint, copy: currentCopyMode)
}
func finishDrag(at screenPoint: NSPoint, copy: Bool) {
@@ -151,10 +153,17 @@
let parts = activePayload.components(separatedBy: "\n")
guard let path = parts.first, !path.isEmpty else { return }
let source = parts.dropFirst().first ?? ""
+ let sourceContainerID = parts.dropFirst(2).first ?? ""
pruneDeadTargets()
if let hitTarget = dropTarget(at: screenPoint) {
- hitTarget.performDrop(path: path, source: source, copy: copy)
+ hitTarget.appDragLocationChanged(screenPoint: screenPoint, copy: copy)
+ hitTarget.performDrop(
+ path: path,
+ source: source,
+ sourceContainerID: sourceContainerID,
+ copy: copy
+ )
return
}
@@ -282,7 +291,9 @@
protocol AppDropTargetReceivingView: AnyObject {
func screenFrame() -> NSRect?
func appDragHoverChanged(active: Bool)
+ func appDragLocationChanged(screenPoint: NSPoint, copy: Bool)
func performDrop(path: String, source: String, copy: Bool)
+ func performDrop(path: String, source: String, sourceContainerID: String, copy: Bool)
}
protocol AppEmptyDropReceivingView: AnyObject {
@@ -300,6 +311,10 @@
extension AppDropTargetReceivingView {
func appDragHoverChanged(active: Bool) {}
+ func appDragLocationChanged(screenPoint: NSPoint, copy: Bool) {}
+ func performDrop(path: String, source: String, sourceContainerID: String, copy: Bool) {
+ performDrop(path: path, source: source, copy: copy)
+ }
}
extension AppEmptyDropReceivingView where Self: NSView {
--
Gitblit v1.9.3