> /dev/null

Interesting hacks, snippets, and shortcuts.

Apr 14

Weird screenshot issue on OS X

While working on my previous post, I ran into an annoying issue.

In OS X, you can take a screenshot of an individual window pressing Cmd-Shift-4 followed by the the spacebar. Screenshots taken this way look quite good; they even include the drop shadow.

Individual window screenshot

Unfortunately, it turns out that the shadow changes size depending on whether the window is in focus.

Here is a window that has focus:

In focus

And here is one that doesn't:

Out of focus

The red border is drawn around the actual edge of the image. Those windows are actually identical in size! It's just the drop shadow that changes.

Thanks to this StackOverflow answer for pointing out that it is focus dependent or I would probably still be trying to figure out why my screenshots were different sizes.