Email or username:

Password:

Forgot your password?
sam henri gold

The SwiftUI/shader method was a bit of a dead-end since it would've meant I had to make a fake Mac window from scratch and then apply the shader. Which is silly and goofy and dumb.

But you know what's even goofier and dumber but more efficient? Abusing private APIs like CGSSetWindowWarp. Making good progress here.

The window remains fully interactive and mouse clicks get translated too, so you can do precise things like use a slider.
hachyderm.io/@samhenrigold/113

15 comments
sam henri gold

oh also I hooked it up to a spring animation and made it fully interruptible weeeeeeeee

Dan Dean

@samhenrigold I hope Apple steals this and puts it right in macOS.

sam henri gold

@dandean This is how they do the genie minimize effect! It's just been undocumented for its whole life (since 2003)

sam henri gold

@grishka I can think of a few reasons:
1. This API has been around for ages and it might just be more broken than it was back in 2003
2. I need to clamp a value somewhere and it’s just been in my blind spot
3. I’m just bad at mesh transforms

sam henri gold

@grishka It was the third one. I had some edge smoothing to fix an edge case that was solved by something else. But that smoothing ended up causing some mesh points to be calculated outside of UV coordinate space. Works like a charm now

Григорий Клюшников

sam henri gold, amazing. Several years ago I wanted to build an app called "widget spinner" where it's a fidget spinner but you spin the entire window containing it. I didn't get it to work the way I imagined. Now that I know about this API I'm gonna try it again

Григорий Клюшников

sam henri gold, yeah it works. There's also CGSSetWindowTransform if you don't need a mesh, so I used that instead

sam henri gold

@grishka Heh, that's neat. I’m thinking they added that for all of those Exposé UIs back in the 2000s

Gregory

@samhenrigold (Smithereen still doesn't support video)

It's so cursed. Now it needs some inertia to feel like the real thing

prom™️

@grishka @samhenrigold Cool - can this be done with a (denormalized) shearing matrix? 😅

Григорий Клюшников

btw the window remains almost fully interactive, this does break hit testing for the title bar (but not close/maximize/minimize buttons) and it jumps if you do manage to start dragging it

Go Up