Bug 568932 - [BigSur] Cannot hover over or inspect variables
On Big Sur, the empty inspect dialog pop-up is caused due to SWT Bug
567787- Setting Shell visible doesn't send SWT.SetData for Virtual
Tree/Table. Due to this the virtual tree in the pop-up is not populated
when set to visible.
The workaround is to call getText on the item so that it is already
created when pop-up is shown.
Change-Id: I241b7c1c75cbc600ad63b4e9d4bd491218d67619
Signed-off-by: Lakshmi Shanmugam <lshanmug@in.ibm.com>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
index f497741..ad25015 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
@@ -16,6 +16,7 @@
import java.util.List;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.DebugPlugin;
@@ -51,6 +52,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPartSite;
@@ -168,6 +170,13 @@
});
fViewer.setInput(treeRoot);
+ // Workaround for empty inspect dialog due to Mac bug (Bug 567787)
+ if (Platform.OS_MACOSX.equals(Platform.getOS())) {
+ fTree.setItemCount(1);
+ TreeItem item = fTree.getItem(0);
+ item.getText();
+ }
+
return fTree;
}