-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Description
To Reproduce
- Run the following slightly modified Snippet 72:
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
public class Main {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Snippet 72");
shell.open();
FileDialog dialog = new FileDialog(shell, SWT.SAVE);
String[] filterNames = new String[] { "ABC (*.abcd)", "PNG (*.png)", "JPG (*.jpg)" };
String[] filterExtensions = new String[] { "*.abcd", "*.png", "*.jpg" };
dialog.setFilterNames(filterNames);
dialog.setFilterExtensions(filterExtensions);
dialog.setFileName("myfile");
dialog.setOverwrite(true);
System.out.println("Save to: " + dialog.open());
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
- When a macOS file dialog is shown, select the second file extension (i.e.
*.png
). - Click Save
The program prints .../myfile.abcd.abcd
.
Expected behavior
The program must have printed .../myfile.png
instead.
Environment:
macOS Sequoia
macOS Tahoe
(older versions of macOS aren't affected)
Copilot
Metadata
Metadata
Assignees
Labels
No labels