[Adium-devl] -[AIAccountMenu menuNeedsUpdate:] - why do we need to rebuild the menus so often?

Colin Barrett timber at lava.net
Wed Nov 28 16:53:34 UTC 2007


On Nov 20, 2007, at 12:16 PM, Evan Schoenberg wrote:

> Every time a command+key combination is pressed,  menuNeedsUpdate: is
> called on the delegates of each item in the various menu bar menus.
> This includes the account menu items.  This triggers a rebuild of the
> submenus in -[AIAccountMenu menuNeedsUpdate:]
>
> We're therefore rebuilding the submenus off the account menu items
> really, really often - practically polling for changes to the account-
> specific menu items.  I assume this has to do with xmpp server-
> provided actions, since it was added along with those.  Is there a
> better way we could approach this, such as finding out when a change
> is needed and flipping a flag to rebuild next time it's needed?

Do menu:updateItem:atIndex:shouldCancel: and numberOfItemsInMenu: fire  
when hitting cmd as well?

We can mitigate this on Leopard by tracking when menus open with  
menuWillOpen/menuWillClose, but bleh.

-Colin




More information about the devel mailing list