diff options
author | Michael Hutchinson <m.j.hutchinson@gmail.com> | 2013-06-25 21:34:25 +0400 |
---|---|---|
committer | Michael Hutchinson <m.j.hutchinson@gmail.com> | 2013-06-25 21:36:12 +0400 |
commit | 04f24912edec23e1938d5563524967b87ee712cc (patch) | |
tree | f55862f9d7e3f38dd10f0a1327a4d0b1cf9e1fbd | |
parent | 9ac641941f87313494671a89a06db8d6413a1ce7 (diff) |
[Mac] BXC12869 - Mac menu updated too often
-rw-r--r-- | main/src/addins/MacPlatform/MacMenu/MDMenu.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/main/src/addins/MacPlatform/MacMenu/MDMenu.cs b/main/src/addins/MacPlatform/MacMenu/MDMenu.cs index 5d03d48e10..c181434c06 100644 --- a/main/src/addins/MacPlatform/MacMenu/MDMenu.cs +++ b/main/src/addins/MacPlatform/MacMenu/MDMenu.cs @@ -149,7 +149,15 @@ namespace MonoDevelop.MacIntegration.MacMenu void MenuNeedsUpdate (NSMenu menu) { Debug.Assert (menu == this); - UpdateCommands (); + + // MacOS calls this for each menu when it's about to open, but also for every menu on every keystroke. + // We only want to do the update when the menu's about to open, since it's expensive. Checking whether + // NSMenuProperty.Image needs to be updated is the only way to distinguish between these cases. + // + // http://www.cocoabuilder.com/archive/cocoa/285859-reason-for-menuneedsupdate-notification.html + // + if (PropertiesToUpdate ().HasFlag (NSMenuProperty.Image)) + UpdateCommands (); } public static void ShowLastSeparator (ref NSMenuItem lastSeparator) |