Index: editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniBoxControlContribution.java |
diff --git a/editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniBoxControlContribution.java b/editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniBoxControlContribution.java |
index 673f2e513287291b4e9ed84eda0f017d4b5bdf09..9645cd53fedfa9801ac2bdbe4eb42794f8979505 100644 |
--- a/editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniBoxControlContribution.java |
+++ b/editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniBoxControlContribution.java |
@@ -29,8 +29,6 @@ import org.eclipse.swt.events.ModifyListener; |
import org.eclipse.swt.events.MouseAdapter; |
import org.eclipse.swt.events.MouseEvent; |
import org.eclipse.swt.events.MouseTrackAdapter; |
-import org.eclipse.swt.events.ShellAdapter; |
-import org.eclipse.swt.events.ShellEvent; |
import org.eclipse.swt.graphics.Point; |
import org.eclipse.swt.widgets.Composite; |
import org.eclipse.swt.widgets.Control; |
@@ -274,7 +272,8 @@ public class OmniBoxControlContribution { |
//outside the search box (or popup) should cause the popup to close |
//We identify this case by keying off focus changes --- if focus |
//is transfered to another control we trigger a close |
- if (Util.isLinux()) { |
+ // scheglov: Actually we need to use "asyncExec" on Mac and Windows too. |
+ { |
//Exec async to ensure that it occurs after the focus change |
Display.getDefault().asyncExec(new Runnable() { |
@Override |
@@ -426,20 +425,6 @@ public class OmniBoxControlContribution { |
handleFocusLost(); |
} |
}); |
- |
- // close popup when Editor lost focus |
- textControl.getShell().addShellListener(new ShellAdapter() { |
- @Override |
- public void shellDeactivated(ShellEvent e) { |
- Shell activeShell = Display.getCurrent().getActiveShell(); |
- if (activeShell == null) { |
- if (popup != null) { |
- popup.close(); |
- popup = null; |
- } |
- } |
- } |
- }); |
} |
private void openPopup() { |