Apple's loss of focus


It’s been bugging me for a while with Mojave. I’ll be working along in a window, and suddenly there’s a flicker, and the current window is no longer current. Something grabbed focus and didn’t give it back. With all the crap that ends up running in the background on modern MacOS, it’s hard to figure out exactly what might be at fault, but I just had one pop up that can’t be blamed on anyone but Apple.

For my recent trip to Japan, I took along a Western Digital 1TB SSD as a Time Machine backup drive, and put it in my checked luggage for redundancy. I turned on Apple’s full-disk encryption (for the laptop as well), so when I plug it in, it pops up a password dialog box.

100% of the time, this dialog box steals focus, and then doesn’t give it back. The front-most application does not have an active window, and I either need to click on it or switch to another app and back again.

The drive is fantastic, by the way. I prefer it to the Samsung T3 and T5 models I’ve used, not the least because it comes with the only high-performance USB3(male)-to-USBC(female) adapter I’ve found, carefully designed to mate securely with the supplied short USBC cable. All the other small adapters I’ve tried significantly degrade performance despite claiming otherwise, but if I could buy a dozen of these (with or without the matched cable), I would. Sadly, WD doesn’t offer them separately.

Related, if you have multiple Time Machine backup sets for your machine, and you want to manually kick off a backup to a specific one (say, /Volumes/BackMe), the script looks like this (note that this requires the third-party jq tool in /usr/local/bin, because Apple plist format is garbage):

#!/bin/bash
export PATH=/usr/bin:/usr/local/bin

VOL=BackMe
if [ ! -d "/Volumes/$VOL" ]; then
        echo "TM backup '$VOL' not mounted!"
        exit 1
fi

ID=$(tmutil destinationinfo -X |
	plutil -convert json -o - - |
	jq -r '.Destinations[]|select(.Name == "'"$VOL"'").ID')
time tmutil startbackup -a -b -d "$ID"

Comments via Isso

Markdown formatting and simple HTML accepted.

Sometimes you have to double-click to enter text in the form (interaction between Isso and Bootstrap?). Tab is more reliable.