Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 79504

Summary: shell not opened if previous shell was disposed when active
Product: [Eclipse Project] Platform Reporter: Platform-SWT-Inbox <platform-swt-inbox>
Component: SWTAssignee: Steve Northover <snorthov>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 80506    
Bug Blocks:    

Description Fai Sigalov CLA 2004-11-25 12:04:03 EST
Run the following code snippet.
If a shell is created, forced active, then disposed, a new shell created and 
opened, the new shell won't open. (It's created, but not given focus, or drawn 
on the display).
If the old  shell isn't forced active or not disposed, the new shell does open.


import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;


public class ShellActive {
    public static void main(String[] args) {
		Display display = new Display();
            Shell shell = new Shell(display);
		shell.forceActive();
		shell.dispose();
		shell = new Shell(display);
		shell.pack();
		shell.open();
		
		while (!shell.isDisposed()) { 
		    if (!display.readAndDispatch()) display.sleep();
            }
            display.dispose();
    }
}
Comment 1 Fai Sigalov CLA 2004-12-10 09:51:04 EST
fixed by bug 80506
> 20041209