From 85b67ecd0b061fc16bf7e34b2a70dacb8762aeff Mon Sep 17 00:00:00 2001 From: David Sparer Date: Sun, 5 Nov 2017 07:24:28 -0600 Subject: [PATCH] fixed bug in connection tree context menu right clicking in white space (no connection tree item selected) made the context menu appear with all options enabled. No context menu should appear in that case --- mRemoteV1/UI/Controls/ConnectionContextMenu.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mRemoteV1/UI/Controls/ConnectionContextMenu.cs b/mRemoteV1/UI/Controls/ConnectionContextMenu.cs index 49bec5db4..3ae6148c0 100644 --- a/mRemoteV1/UI/Controls/ConnectionContextMenu.cs +++ b/mRemoteV1/UI/Controls/ConnectionContextMenu.cs @@ -60,9 +60,13 @@ namespace mRemoteNG.UI.Controls Opening += (sender, args) => { AddExternalApps(); + if (_connectionTree.SelectedNode == null) + { + args.Cancel = true; + return; + } ShowHideMenuItems(); }; - Closing += (sender, args) => EnableMenuItemsRecursive(Items); } private void InitializeComponent() @@ -397,9 +401,6 @@ namespace mRemoteNG.UI.Controls internal void ShowHideMenuItems() { - if (_connectionTree.SelectedNode == null) - return; - try { Enabled = true;