diff options
3 files changed, 8 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java index 890f5a61bf..df87e15f40 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java @@ -23,7 +23,7 @@ class MozillaDelegate { Listener listener; boolean hasFocus; - static final String SET_MOZILLA_COUNT = "org.eclipse.swt.internal.setMozillaCount"; //$NON-NLS-1$ + static final String MOZILLA_RUNNING = "org.eclipse.swt.internal.mozillaRunning"; //$NON-NLS-1$ MozillaDelegate (Browser browser) { super (); @@ -125,7 +125,7 @@ void addWindowSubclass () { } int createBaseWindow (nsIBaseWindow baseWindow) { - browser.getDisplay ().setData (SET_MOZILLA_COUNT, new Integer (Mozilla.BrowserCount)); + browser.getDisplay ().setData (MOZILLA_RUNNING, Boolean.TRUE); /* * Feature of Mozilla on OSX. Mozilla replaces the OSX application menu whenever @@ -194,7 +194,6 @@ void onDispose (int /*long*/ embedHandle) { eventShell = null; listener = null; } - browser.getDisplay ().setData (SET_MOZILLA_COUNT, new Integer (Mozilla.BrowserCount)); browser = null; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java index 481c148c1a..c4ed39d3de 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java @@ -2708,12 +2708,11 @@ void onDispose (Display display) { } functions = null; - BrowserCount--; - delegate.onDispose (embedHandle); delegate = null; embedHandle = 0; + BrowserCount--; } void Activate () { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java index 29435c0d71..40db02f0ba 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java @@ -176,8 +176,8 @@ public class Display extends Device { Callback cursorSetCallback; boolean comboPoppedUp = false; - int mozillaCount; - static final String SET_MOZILLA_COUNT = "org.eclipse.swt.internal.setMozillaCount"; //$NON-NLS-1$ + boolean mozillaRunning; + static final String MOZILLA_RUNNING = "org.eclipse.swt.internal.mozillaRunning"; //$NON-NLS-1$ // the following Callbacks are never freed static Callback windowCallback2, windowCallback3, windowCallback4, windowCallback5, windowCallback6; @@ -4372,8 +4372,8 @@ public void setData (String key, Object value) { } } - if (key.equals (SET_MOZILLA_COUNT)) { - mozillaCount = ((Integer)value).intValue (); + if (key.equals (MOZILLA_RUNNING)) { + mozillaRunning = ((Boolean)value).booleanValue (); } /* Remove the key/value pair */ @@ -4882,7 +4882,7 @@ int /*long*/ applicationNextEventMatchingMask (int /*long*/ id, int /*long*/ sel * workaround is to detect this case and to not return the event that would trigger * this to happen. */ - if (comboPoppedUp && mozillaCount > 0 && dequeue != 0) { + if (comboPoppedUp && mozillaRunning && dequeue != 0) { NSEvent event = new NSEvent(result); if (event.type() == OS.NSApplicationDefined) { return 0; |