Getting NSPanel “Non activating” style functionality on an NSWindow

I’d appreciate any guidance you can offer here. NSPanel has a “Non activating” option for HUD Panels. I’d like to get that same functionality working on an NSWindow, i.e. I want the window to accept clicks but not take focus away from whatever the active app is.

I have tried creating an NSWindow subclass and setting canBecomeMainWindow and canBecomeKeyWindow to NO but that doesn’t seem to be working—I think because those settings only apply to windows within the same app.

What I’m trying to do here is prevent this flickering:

Sketch Panels gif

I’m pretty sure this is doable as apps like Alfred seem to be doing it but having spent the last couple of hours Googling I just can’t get it to work.

If you have any suggestions to share, thanks in advance!

Stack Overflow cross-post.

Specify: Quickly generate a shape with specific dimensions in Sketch

The rectangle creation view in Specify

Yummygum were on Twitter yesterday searching for a Sketch plugin to generate a shape based off of specific user-inputted dimensions. As it happened, there wasn’t one. So I built one.

Specify has a couple of nice features that the Photoshop one doesn’t:

  • If you have a layer selected, it will automatically set the initial x and y values to those of the selected layer.
  • It supports Sketch’s differently-sized-border-radii syntax of, for example, 4/4/0/0 for top left 4, top right 4, bottom right 0, bottom left 0.

The source for it is up on GitHub, along with the installation instructions and more information on customisation. The JS is fairly well commented too if you want to go and have a look at how it works.

Download on GitHub