Bug 120921 [PopupDialog] Keybindings lost after using PopupDialog
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/PopupDialog.java
*/
				if (listenToDeactivate && event.widget == getShell()
						&& getShell().getShells().length == 0) {
					close();
				} else {
					/* We typically ignore deactivates to work around platform-specific
					 * event ordering.  Now that we've ignored whatever we were supposed to,
					 * start listening to deactivates.  Example issues can be found in
					 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=123392
					 */
					listenToDeactivate = true;
				}
			}
		});
		
		
		shell.addListener(SWT.Activate, new Listener() {
			public void handleEvent(Event event) {
				
				if (event.widget == getShell()
						&& getShell().getShells().length == 0) {
					listenToDeactivate = true;
					
					
					
					
					listenToParentDeactivate = !"carbon".equals(SWT.getPlatform()); 
				}
			}
		});