Browse Source

Avoid deselecting watch items on right-click menu popup

Brian Fiete 1 year ago
parent
commit
16ed9ff8cf
2 changed files with 18 additions and 1 deletions
  1. 17 0
      IDE/src/IDEApp.bf
  2. 1 1
      IDE/src/ui/WatchPanel.bf

+ 17 - 0
IDE/src/IDEApp.bf

@@ -568,6 +568,23 @@ namespace IDE
 			}
 		}
 
+		public bool MenuHasFocus
+		{
+			get
+			{
+				for (var window in mWindows)
+				{
+					var widgetWindow = window as WidgetWindow;
+					if ((widgetWindow != null) && (widgetWindow.mHasFocus))
+					{
+						if (widgetWindow.mRootWidget is MenuContainer)
+							return true;
+					}
+				}
+				return false;
+			}
+		}
+
 		[CallingConvention(.Stdcall),CLink]
 		static extern void IDEHelper_ProgramStart();
 		[CallingConvention(.Stdcall),CLink]

+ 1 - 1
IDE/src/ui/WatchPanel.bf

@@ -4117,7 +4117,7 @@ namespace IDE.ui
 
             CheckClearDirtyWatches();
 
-			if ((mDeselectOnFocusLost) && (!HasFocus) && (mListView.mFindWidget == null))
+			if ((mDeselectOnFocusLost) && (!HasFocus) && (mListView.mFindWidget == null) && (!gApp.MenuHasFocus))
 				mListView.GetRoot().SelectItemExclusively(null);
 
 			//mListView.m