deactivate = true;
deferDispose = true;
int kEventWindowDeactivated (int nextHandler, int theEvent, int userData) {	int result = super.kEventWindowDeactivated (nextHandler, theEvent, userData);	if (result == OS.noErr) return result;	if (active) {		deactivate = true;		active = false;		Display display = this.display;		sendEvent (SWT.Deactivate);		if (isDisposed ()) return result;		saveFocus ();		if (savedFocus != null) {			/*			* Bug in the Macintosh.  When ClearKeyboardFocus() is called,			* the control that has focus gets two kEventControlSetFocus			* events indicating that focus was lost.  The fix is to ignore			* both of these and send the focus lost event explicitly.			*/			display.ignoreFocus = true;			OS.ClearKeyboardFocus (shellHandle);			display.ignoreFocus = false;			if (!savedFocus.isDisposed ()) savedFocus.sendFocusEvent (SWT.FocusOut, false);		}		display.setMenuBar (null);		deactivate = false;	}	return result;}