From 843e56c0df42aec34a487b97483a0b6c866fff95 Mon Sep 17 00:00:00 2001 From: Phillipus Date: Mon, 8 Jul 2024 17:33:24 +0100 Subject: [PATCH] Fix possible SWTException "Widget is disposed" exception when displaying a Tooltip If a workbench part is detached and a tooltip is initially displayed, when the part is re-attached the parent Shell is disposed which in turn disposes of the PopupHelper's Shell. This will lead to an SWT Error when the Shell is accessed again. To fix this, create the PopupHelper Shell with the Control's Display instead of its Shell. See https://github.com/eclipse/gef-classic/issues/469 --- org.eclipse.draw2d/src/org/eclipse/draw2d/PopUpHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.draw2d/src/org/eclipse/draw2d/PopUpHelper.java b/org.eclipse.draw2d/src/org/eclipse/draw2d/PopUpHelper.java index 54e39087d..312a0a0ca 100644 --- a/org.eclipse.draw2d/src/org/eclipse/draw2d/PopUpHelper.java +++ b/org.eclipse.draw2d/src/org/eclipse/draw2d/PopUpHelper.java @@ -84,7 +84,7 @@ protected LightweightSystem createLightweightSystem() { * @since 2.0 */ protected Shell createShell() { - return new Shell(control.getShell(), shellStyle); + return new Shell(control.getDisplay(), shellStyle); } /**