Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313740 - Unable to select any window when JFace warning dialog and file browse dialog are both open
Summary: Unable to select any window when JFace warning dialog and file browse dialog ...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4.2   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 3.6.1   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 10:39 EDT by Tim CLA
Modified: 2010-08-06 14:48 EDT (History)
8 users (show)

See Also:
eclipse.felipe: review+


Attachments
patch (7.40 KB, patch)
2010-05-25 12:53 EDT, Silenio Quarti CLA
no flags Details | Diff
patch for HEAD (FileDialog and DirectoryDialog) (8.47 KB, patch)
2010-07-08 17:43 EDT, Silenio Quarti CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim CLA 2010-05-20 10:39:17 EDT
Build Identifier: 3.4.2.M20090107-0800

If you open the preference page, then from there click on a Browse button to open a file browser dialog, then trigger some event that causes an org.eclipse.jface.dialogs.MessageDialog.openWarning() call to happen, you end up with a warning dialog under the file browser, and neither one can actually be clicked on, thus causing a locking situation. The user must force quit the application. There does not seem to be an appropriate SWT style that will allow a dialog like this to be on top of a File Browser or similar system level dialog (such as the Font picker). 

Reproducible: Always

Steps to Reproduce:
1. Go to a preference page that has a Browse... button on it. Click it to open a file browser dialog
2. With that dialog open, call org.eclipse.jface.dialogs.MessageDialog.openWarning()
3. Two windows are open, neither one can be dismissed. Must force quit the application.
Comment 1 Scott Kovatch CLA 2010-05-20 16:50:15 EDT
Does this happen in 3.5 or 3.6 carbon? There won't be any updates to the 3.4 stream (that I'm aware of.)
Comment 2 Raji Akella CLA 2010-05-21 10:19:12 EDT
This is being seen in Lotus Sametime and the team has confirmed that they see this issue on 3.5.2 Carbon.
Comment 3 Bogdan Gheorghe CLA 2010-05-25 11:14:53 EDT
The problem still happens in carbon HEAD. Here is a test case.

public static void main(String[] args) {
	final Display display = new Display();
	final Shell shell = new Shell(display);
	shell.setLayout(new GridLayout());
	
	Button b = new Button(shell, SWT.PUSH);
	b.setText("Open File Dialog");
	b.addListener(SWT.Selection, new Listener() {
		public void handleEvent(Event event) {
			FileDialog dialog = new FileDialog(shell, SWT.NONE);
			display.asyncExec(new Runnable() {
				public void run() {
					// Problem does not happen with MessageBox
//					MessageBox box = new MessageBox(shell, SWT.NONE);
//					box.setText("Hi");
//					box.setMessage("Hello");
//					box.open();
					final Shell dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
					dialog.setLayout(new GridLayout());
					Button b = new Button(dialog, SWT.PUSH);
					b.setText("Close");
					b.addListener(SWT.Selection, new Listener() {
						public void handleEvent(Event event) {
							dialog.close();
						}
					});
					dialog.pack();
					dialog.open();
					while (!dialog.isDisposed()) {
						if (!display.readAndDispatch()) display.sleep();
					}
				}
			});
			dialog.open();
		}
	});
	
	shell.pack();
	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
	display.dispose();
}
Comment 4 Silenio Quarti CLA 2010-05-25 11:15:45 EDT
Comment above is mine.
Comment 5 Silenio Quarti CLA 2010-05-25 12:53:22 EDT
Created attachment 169855 [details]
patch

This is a possible fix for HEAD. It needs a lot more testing. Depending how testing goes it will be released after 3.6 ships.
Comment 6 Raji Akella CLA 2010-06-30 15:01:53 EDT
Fix is working for us for file dialog. Sametime team is now requesting similar fix for directory dialog.
Comment 7 Raji Akella CLA 2010-07-07 11:56:42 EDT
Do you want Tim to open a separate bugzilla for DirectoryDialog?
Comment 8 Silenio Quarti CLA 2010-07-07 14:15:11 EDT
No need.

Note that I will only be able to investigate the DirectoryDialog case next week.
Comment 9 Silenio Quarti CLA 2010-07-08 17:43:10 EDT
Created attachment 173823 [details]
patch for HEAD (FileDialog and DirectoryDialog)
Comment 10 Silenio Quarti CLA 2010-07-08 18:01:22 EDT
Fixed > 20100708 (HEAD only)
Comment 11 Raji Akella CLA 2010-08-05 19:35:26 EDT
Can you please include this fix in 3.6.1?
Comment 12 Silenio Quarti CLA 2010-08-06 12:19:19 EDT
Felipe, please review for 3.6.1
Comment 13 Silenio Quarti CLA 2010-08-06 14:48:19 EDT
Fix released to R3_6_maintenance.