Reading view

There are new articles available, click to refresh the page.

A brief history of icons, thumbnails and QuickLook

One of the novel features in the original Finder in Classic Mac OS was the use of distinctive icons for different types of document in an extensible scheme.

Every file had its type and creator codes, each consisting of four single-byte characters. The Desktop databases contained indexes to those, to enable the Finder to display the appropriate icon for a text document of type TEXT created by an app with the creator code of ttxt, SimpleText, for instance.

Apps provided a custom icon in their Resource fork for each type of document they supported. Periodically, those Desktop databases became broken, and documents lost their custom icons. The solution was to rebuild those Desktop databases from the data in each app’s Resources, a procedure that every Mac user became only too familiar with.

At some stage, perhaps in System 6 of 1988, or System 7 of 1991, document icons such as images could be displayed as miniatures or thumbnails instead. This was accomplished by apps creating that file’s thumbnail and saving it as an ICN# resource in the file’s Resource fork. Amazingly, this still works in Sequoia, where I pasted a prepared Resource fork into a Zip file to give it an inappropriate thumbnail.

qlthumbnail1

The raw Resource fork is shown below in xattred as a com.apple.ResourceFork extended attribute.

qlthumbnail2

Initially, Mac OS X continued a similar system, including custom thumbnails, until Apple introduced Quick Look in Mac OS X 10.5 Leopard, in 2007. This came with built-in support for a wide range of common document types, extending to QuickTime media including audio and video. One curious omission at first was that animated GIFs weren’t supported as animations until OS X 10.7.

Display of Thumbnails used the QuickLook framework documented here. This enabled third-parties to extend coverage to their own document types using QuickLook generators with the extension .qlgenerator. Initially, they were installed into /Library/QuickLook from each app bundle.

Normally, when QuickLook generated a Thumbnail or Preview, that was stored in its cache database kept in NSTemporaryDirectory in the path C/com.apple.QuickLook.thumbnailcache/. Those could give revealing insights into images and other documents accessed recently, and Wojciech Regula and Patrick Wardle discovered that, in High Sierra and earlier, it was easy for malicious software to examine that cache. Apple addressed that in macOS 10.14 Mojave by making the cache completely inaccessible.

In-memory caching of Thumbnails has also proved controversial in more recent versions of macOS. To deliver smooth scrolling of Thumbnails in the Finder’s Gallery views in particular, the Finder has taken to caching them in memory for up to two days, sometimes using several GB in the process. That can readily be mistaken for a memory leak, until those cached Thumbnails are finally flushed.

I described how QuickLook Thumbnails worked in early 2019, in the days before the SSV.

getdocicon01

When you select a document in the Finder, a dialog, or somewhere else where you expect its icon to be shown, the Finder passes details of the document path and its type (UTI) to IconServices, to fetch the appropriate icon. This calls on its main service, iconservicesd in /System/Library/CoreServices, to check its icon cache.

Although the main icon store is locked away in /Library/Caches/com.apple.iconservices.store, there’s additional data in a folder on a path based on /private/var/folders/…/C/com.apple.iconservices, where … is an unreadable alphanumeric name. For icons used in the Dock, their cache is at /private/var/folders/…/C/com.apple.dock.iconcache. If the icon should be replaced by a QuickLook Thumbnail, such as in a Finder column view, QuickLook is asked to provide that thumbnail. That in turn may be cached in its protected cache at /private/var/folders/…/C/com.apple.QuickLook.thumbnailcache.

QuickLook then relies on there being an appropriate qlgenerator to create a thumbnail of that document type; if the qlgenerator is flawed or can’t cope with the document’s contents, that could easily fall over. For example, if you renamed a text file with a .jpeg extension so that macOS considered it was a JPEG image, the bundled qlgenerator might have simply resulted in the display of a busy spinner, rather than resolving to a generic JPEG document icon. IconServices should then deliver the appropriate icon back to the Finder to display it.

In macOS 10.15 Catalina (2019), Apple started replacing this system with a new framework named QuickLook Thumbnailing, documented here. That replaces qlgenerators with QuickLook preview extensions, in particular Thumbnail Extensions, as explained to developers at WWDC in 2019.

macOS 15.0 Sequoia has finally removed support for qlgenerators. That has resulted in the unfortunate loss of custom Thumbnails and Previews for document types of third-party apps that are still reliant on qlgenerators, and haven’t yet got round to providing equivalent app extensions. It’s almost as if the Desktop databases need to be rebuilt again.

A visual sampler of window layouts in Sequoia

Recent versions of macOS have added new ways to lay out windows, including Stage Manager and most recently tiling. This collection of screenshots demonstrates the repertoire available in macOS 15 Sequoia, with brief notes to suggest how to get the best from them. Controls and options for most of these are in Desktop & Dock settings, except where given otherwise. There are also many third-party enhancements available: those are intentionally omitted for the sake of simplicity and clarity. Similarly, there are often several different controls and actions that can achieve the same effect. Only the more obvious are given here. To enlarge any of the screenshots below, click on the image.

Full screen single window

sample1xcodefullscreen

This is the simplest of all, best suited to windows already containing multiple views that need full space, here with Xcode. Control whether the window is displayed with or without the menu bar in Control Centre settings, in Automatically hide and show the menu bar at its foot. Integrate this with access to the Finder and other apps by setting it in its own Space.

To put a window in full screen mode, click on its green traffic light control at its top left, or use the command in the View menu. To exit, use the same controls.

Freestyle overlapping

sample2freestyle

Probably the most traditional and popular layout, with multiple overlapping windows from different apps. Although dynamic and flexible, it’s easy to lose track of apps and windows in their multiple layers.

sample3missionctl

To find a lost window or app, enter Mission Control by pressing the F3 key, then click on the window to bring it into focus. Switch focus between apps by selecting the app in the Dock.

Use the Desktop to collect your working documents, or set it as wallpaper.

Tiled

sample4bbeditsplit

Some apps, here BBEdit in its Find Differences feature, tile multiple views into a single window, here with linked scrollers. Sequoia provides additional tools to tile app windows so they don’t overlap. These are best suited to layouts with 2-4 windows occupying similar areas, but can be adapted for others.

sample5splitview

Simplest are two windows arranged in a split view, either horizontally or vertically. Arrange them using the Move & Resize commands in the Window menu, from the window’s green traffic light control popup menu, or by moving the window with controls enabled in Desktop & Dock settings. Note the latter don’t work with windows dragged to the bottom edge of the screen, only the top and sides.

sample6tiled4

For those who like a clean, regular look with four open windows, tile them into quadrants with the same controls. This shows the small gaps between windows when Tiled windows have margins is enabled in Desktop & Dock settings.

sample7tiled4adj

Use a regular tiled layout adjusted to suit their contents better. Resizing windows manually loses the margins of the original tiling.

sample8fssplit1

The alternative Full Screen Split View is quick to create. To put the currently focussed window into one half, use one of the Full Screen Tile options in the Window menu, or its green traffic light popup menu. That puts the other half of the display into Mission Control, where you select the window to place in the other half of the Split View.

sample9fssplit2

Adjust the balance between the size of the two windows using the central bar. To return the windows to normal, click on their green traffic light control.

On their own, tiled layouts are constraining, but when used in their own Space can be valuable.

Stage Manager

sample9stageman

Stage Manager puts a suite of windows from one or more apps into a single active group on stage, with quick switching between different suites. Enable and control it in its section in Desktop & Dock settings. Switch between different window groups simply by clicking on them in the icon list at the left.

sample10stageman2

Management of suites is dynamic, and detailed in the following articles:

  1. Getting started
  2. Workflow strategies
  3. Apps and windows

For further flexibility, use Stage Manager in one or more Spaces.

Spaces

sample12spaces

Spaces are complete Desktop layouts you can switch between, accessed through Mission Control. To create a second Space, press F3 for Mission Control and move your pointer to the top of the display, then click on the + at the right. Options are at the very bottom of Desktop & Dock settings. Any of the above layouts can be included as a Space.

Multiviews

sample13multiview

One remaining problem with layouts is support for multiple views of the same document. Better text editors let you split a window into two views of the same document, useful when you need to refer back while editing. Browsers will open two tabs or windows on the same page. However, very few PDF viewers let you view more than one section at once of the same PDF in multiple windows. That’s a feature of my free Podofyllin.

Apple Help

Have fun exploring all of these.

❌