QLPreviewPanel takes forever to load content preview in macOS 26

After upgrading to macOS 26, I noticed that showing a Quicklook preview in my app is very slow. Showing small text files is fine, but some other files I've tried, such as a Numbers document, take about 30 seconds (during which the indeterminate loading indicator appears) before the preview is shown. When showing the preview of an app, such as Xcode, the panel opens immediately with a placeholder image for the Xcode icon, and the actual Xcode icon is shown only after about 25 seconds. During this time many logs appear:

FPItemsFromURLsWithTimeout timed out (5.000000s) for: file:///.file/id=6571367.2/ (/)
FPItemsFromURLsWithTimeout timed out (5.000000s) for: file:///.file/id=6571367.23684/ (/Users)
FPItemsFromURLsWithTimeout timed out (5.000000s) for: file:///.file/id=6571367.248032/ (/Users/n{9}k)
FPItemsFromURLsWithTimeout timed out (5.000000s) for: file:///.file/id=6571367.248084/ (/Users/n{9}k/Downloads)
Failed to add registration dmf.policy.monitor.app with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.dmd.policy was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.dmd.policy was invalidated: failed at lookup with error 159 - Sandbox restriction.}
Failed to register application policy monitor with identifier 69DDBDB4-0736-42FA-BA7A-C8D7EA049E29 for types {(
    applicationcategories,
    websites,
    categories,
    applications
)} with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.dmd.policy was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.dmd.policy was invalidated: failed at lookup with error 159 - Sandbox restriction.}
FPItemsFromURLsWithTimeout timed out (5.000000s) for: file:///.file/id=6571367.155797561/ (~/Downloads/X{3}e.app)

It seems that Quicklook tries to access each parent directory of the previewed file, and each one fails after 5 seconds.

Why is Quicklook all of a sudden so slow? It used to be almost instant in macOS 15.

I created FB20268201.


import Cocoa
import Quartz

@main
class AppDelegate: NSObject, NSApplicationDelegate, QLPreviewPanelDataSource, QLPreviewPanelDelegate {
    
    var url: URL?
    
    func applicationDidFinishLaunching(_ notification: Notification) {
        let openPanel = NSOpenPanel()
        openPanel.runModal()
        url = openPanel.urls[0]
        QLPreviewPanel.shared()!.makeKeyAndOrderFront(nil)
    }
    
    override func acceptsPreviewPanelControl(_ panel: QLPreviewPanel!) -> Bool {
        return true
    }
    
    override func beginPreviewPanelControl(_ panel: QLPreviewPanel!) {
        panel.dataSource = self
        panel.delegate = self
    }
    
    override func endPreviewPanelControl(_ panel: QLPreviewPanel!) {
        panel.dataSource = nil
        panel.delegate = nil
    }
    
    func numberOfPreviewItems(in panel: QLPreviewPanel!) -> Int {
        return 1
    }
    
    func previewPanel(_ panel: QLPreviewPanel!, previewItemAt index: Int) -> QLPreviewItem! {
        return url as? QLPreviewItem
    }
    
}

Have the same problem with QuickLook. Maybe there is a new privacy tag required in Info.plist?

Excatly the same issue with the same code used for years. Tested on macOS 26.0, 26.1 and 26.2 RC. My app is sandboxed, and access to the files is made through the NSOpenPanel first (Macintosh HD folder).

Same log message and behavior: takes a long time.

Can a DTS engineer tell us what's going wrong?

I noticed this with QLPreviewView--images for .apps take forever to load. Zip files too and I'm sure there are other file types I don't know about. I filed FB20797520 back in October.

Considering making the thumbnail myself for these certain file types that I've found to be slow because this is degrading my app but I've been somewhat overwhelmed by these types of bugs I really don't want to write another one of these ugly workarounds. Kind of hoping they just fix it in a timely fashion. Fingers crossed.

My app is sandboxed, and access to the files is made through the NSOpenPanel first (Macintosh HD folder).

I have non-sandboxed app version of an app and QLPreviewView still takes around 30 seconds to load app icon images.

In another part of my app I don't use QLPreviewView but load thumbnails with QLThumbnailGenerator. QLThumbnailGenerator seems to load the thumbnail images quickly.

I just checked it and it seems like Numbers implemented in HTML or something. I get the same long delay with a bunch of messages about networking, non-existent processes, WebProcessProxy, and WebPageProxy. Then I finally get a failure message "DID FAIL LOADING QLWeb2DisplayBundle" and the preview appears.

But my app doesn't have networking. If I enable outgoing client, then the preview appears more or less instantly. The preview still isn't correct. Instead of being a large icon, it's the upper left portion of the content.

QLThumbnailGenerator sounds like an interesting idea.

By the way, I've tested the QLPreviewView and It's also affected by the same issue!

So instead of using QLPreviewPanel, we could generate the thumbnail with QLThumbnailGenerator and then display the result in our app?

It seems a lot of work for something Apple should fix 😅

QLPreviewPanel takes forever to load content preview in macOS 26
 
 
Q