Skip to content

Commit

Permalink
Use proper shell for modal dialogs
Browse files Browse the repository at this point in the history
This prevents the dialogs to appear behind the possible opened progress
dialog (or any other modal dialog).

See eclipse-platform/eclipse.platform#1373
  • Loading branch information
iloveeclipse committed May 16, 2024
1 parent 4d38cc7 commit f8121d1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@

import org.eclipse.jface.dialogs.MessageDialog;

import org.eclipse.ui.PlatformUI;

import org.eclipse.debug.core.IStatusHandler;

import org.eclipse.jdt.internal.junit.ui.JUnitMessages;
import org.eclipse.jdt.internal.junit.ui.JUnitPlugin;

public class LaunchErrorStatusHandler implements IStatusHandler {

Expand All @@ -35,7 +36,7 @@ public Object handleStatus(final IStatus status, Object source) throws CoreExcep
final AtomicBoolean success= new AtomicBoolean(false);
getDisplay().syncExec(
() -> {
Shell shell= JUnitPlugin.getActiveWorkbenchShell();
Shell shell= PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();
if (shell == null)
shell= getDisplay().getActiveShell();
if (shell != null) {
Expand Down

0 comments on commit f8121d1

Please sign in to comment.