Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Ungureanu <marius.ungureanu@xamarin.com>2016-01-22 09:28:50 +0300
committerMarius Ungureanu <marius.ungureanu@xamarin.com>2016-01-22 09:29:32 +0300
commitd582d51d69d759dfce3d3d1c3f22f1a33efe6e37 (patch)
tree2ad8f373986acc22dcbc7ecbd4ca840e96c060d7 /main/src/addins/WindowsPlatform
parentd65408eb13b1b2b62dce149bc768dda0ab84090b (diff)
[Windows] Fix SubmenuClosing leaks of TitleMenuItem.
Diffstat (limited to 'main/src/addins/WindowsPlatform')
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleMenuItem.cs18
1 files changed, 9 insertions, 9 deletions
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleMenuItem.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleMenuItem.cs
index 68eca066b5..b2053eaea7 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleMenuItem.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleMenuItem.cs
@@ -70,12 +70,6 @@ namespace WindowsPlatform.MainToolbar
Height = SystemParameters.CaptionHeight;
UseLayoutRounding = true;
-
- SubmenuClosing += (o, e) => {
- bool shouldFocusIde = !menu.Items.OfType<MenuItem> ().Any (mi => mi.IsSubmenuOpen);
- if (shouldFocusIde)
- IdeApp.Workbench.RootWindow.Present ();
- };
}
Menu menu;
@@ -212,7 +206,7 @@ namespace WindowsPlatform.MainToolbar
Clear ();
if (!closingSent) {
- SubmenuClosing?.Invoke (this, e);
+ OnSubmenuClosing ();
closingSent = false;
}
@@ -225,7 +219,7 @@ namespace WindowsPlatform.MainToolbar
return;
closingSent = true;
- SubmenuClosing?.Invoke (this, e);
+ OnSubmenuClosing ();
Xwt.Application.Invoke(() => {
if (commandArrayInfo != null) {
@@ -241,7 +235,13 @@ namespace WindowsPlatform.MainToolbar
DesktopService.ShowUrl (menuLinkEntry.Url);
}
- internal event EventHandler SubmenuClosing;
+ void OnSubmenuClosing ()
+ {
+ bool shouldFocusIde = !menu.Items.OfType<MenuItem> ().Any (mi => mi.IsSubmenuOpen);
+ if (shouldFocusIde)
+ IdeApp.Workbench.RootWindow.Present ();
+ }
+
readonly MonoDevelop.Components.Commands.CommandManager manager;
readonly object initialCommandTarget;
readonly CommandSource commandSource;