mjolnirapp / mjolnir

Lightweight automation and productivity app for OS X
5.21k stars 128 forks source link

Function to determine if window frame is fixed #540

Closed drn closed 8 years ago

drn commented 9 years ago

Hey @sdegutis ,

I'm looking for a way to determine if a window's frame is fixed. Looking at the window source, it looks like that property isn't exposed in the current API and my knowledge of the accessibility api is lacking.

The functionality I'm trying to achieve is to auto-center windows in the frames I resize them to if their dimensions are fixed without resizing twice. I achieved the desired functionality here (by resizing, checking dimensions, and justifying if necessary): https://github.com/drn/dotfiles/blob/master/mjolnir/resize.lua#L53 but this results in the window jumping around the screen as a result of the double set frame.

Perhaps you can think of a better way of doing this?

Thanks for the help. Loving mjolnir so far. Great work! Switched the majority of my global mappings to mjolnir already

Cheers, Darren

drn commented 8 years ago

Closing this, as I've since switched over to https://github.com/Hammerspoon/hammerspoon. Thanks for this awesome project!