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 f9fb399 commit a42910f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.internal.views.log.LogView;

Expand All @@ -60,7 +61,7 @@ private void handleOtherReasonsFoundInLog(final ILaunch launch) {
try {
File log = LaunchListener.getMostRecentLogFile(launch.getLaunchConfiguration());
if (log != null && log.exists()) {
MessageDialog dialog = new MessageDialog(PDEPlugin.getActiveWorkbenchShell(), PDEUIMessages.Launcher_error_title, null, // accept the default window icon
MessageDialog dialog = new MessageDialog(PlatformUI.getWorkbench().getModalDialogShellProvider().getShell(), PDEUIMessages.Launcher_error_title, null, // accept the default window icon
PDEUIMessages.Launcher_error_code13, MessageDialog.ERROR, new String[] {PDEUIMessages.Launcher_error_displayInLogView, PDEUIMessages.Launcher_error_displayInSystemEditor, IDialogConstants.NO_LABEL}, OPEN_IN_ERROR_LOG_VIEW);
int dialog_value = dialog.open();
if (dialog_value == OPEN_IN_ERROR_LOG_VIEW) {
Expand Down

0 comments on commit a42910f

Please sign in to comment.