How to remove window resize animation on Mac OS X?

BlitzMax Forums/BlitzMax Programming/How to remove window resize animation on Mac OS X?

matt!(Posted 2011) [#1]
I'm using some BMX mod tweaks to enabled the minimise and maximise buttons on Mac OS X gui window apps. See here: http://www.blitzbasic.com/Community/posts.php?topic=95075

I want to use the maximise button to allow the user to toggle between a original and doubled window sizes. The code below shows how i am doing it. But there's an odd animation.

I know in Objective-C when resizing a window you can specify whether or not this animation is used, see here: http://borkware.com/quickies/single?id=272

So, my question is, how can I switch of the window resize animation in BMX gui window apps?

Any help appreciated.

Cheers,
matt



Last edited 2011


DrDeath(Posted 2011) [#2]
Huh? What version of Mac OS X are you using? I'm on Snow Leopard and have no animation when maximising windows whatsoever.


matt!(Posted 2011) [#3]
I'm running OS 10.7 Lion

Here's a video: http://www.youtube.com/watch?v=x1WUFs_4nG8


jkrankie(Posted 2011) [#4]
On Snow Leopard, the window flashes the full size of the desktop before going to the right size.

Cheers
Charlie


matt!(Posted 2011) [#5]
Thanks for the confirmation Charlie.

I'm still poking around in the BMX code to see if I can control this behaviour.

And wondering whether I should just ship with the double size game window...


DrDeath(Posted 2011) [#6]
I see. That's one of the pointless default eye candy Apple unfortunately decided to include in Lion.

As far as I understand that, this "setFrame:display:animate:" function described in your link has nothing to do with that. That function predates the Lion animations by years. For an example of animations made with this, select any icon in the Finder and open the "Get Info" window (cmd+I). When you click on one of the arrows, the window changes its size to adapt to its content with an animation.

This Lion animation crap (another one would be the animation when opening a window) can – as far as I know – not be disabled on a per-window-basis, only system-wide (with a plist hack).

Last edited 2011


matt!(Posted 2011) [#7]
Can you post a link to the plist hack? I've not been able to disable this animation system wide in any way.

As Charlie says, this isn't just Lion. Though the effects are more pronounced in that.

Also, how is it on that soap box? ;)


DrDeath(Posted 2011) [#8]
This should do the trick (when entered in the Terminal):
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO

(Can't test it myself since I – as mentioned – still use Snow Leopard... and intend to stick to it for the foreseeable future.)

Last edited 2011


matt!(Posted 2011) [#9]
That's not the animation that is causing me problems. That switches the animation that causes a new window to "grow" from a small version to a large version, or "pop" into view.

But thanks for trying.