full screen mode on OS X Lion / [spleaner]

This commit is contained in:
Konstantin Bulenkov
2011-12-12 18:25:33 +04:00
parent 8a451591c7
commit a3535f7ee0
@@ -36,7 +36,10 @@ import com.intellij.openapi.ui.Queryable;
import com.intellij.openapi.ui.popup.StackingPopupDispatcher;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.wm.*;
import com.intellij.openapi.wm.FocusCommand;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.KeyEventProcessor;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.openapi.wm.ex.LayoutFocusTraversalPolicyExt;
import com.intellij.openapi.wm.ex.WindowManagerEx;
import com.intellij.openapi.wm.impl.IdeFrameImpl;
@@ -45,6 +48,9 @@ import com.intellij.ui.AppUIUtil;
import com.intellij.ui.FocusTrackback;
import com.intellij.ui.ScreenUtil;
import com.intellij.ui.SpeedSearchBase;
import com.intellij.ui.mac.foundation.Foundation;
import com.intellij.ui.mac.foundation.ID;
import com.intellij.ui.mac.foundation.MacUtil;
import com.intellij.ui.popup.StackingPopupDispatcherImpl;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
@@ -681,6 +687,25 @@ public class DialogWrapperPeerImpl extends DialogWrapperPeer implements FocusTra
}
}
if (SystemInfo.isMacOSLion) {
final WindowAdapter macFullScreenPatchListener = new WindowAdapter() {
@Override
public void windowOpened(WindowEvent e) {
Window window = e.getWindow();
if (window instanceof Dialog) {
ID _native = MacUtil.findWindowForTitle(((Dialog)window).getTitle());
if (_native != null && _native.intValue() > 0) {
// see MacMainFrameDecorator
// NSCollectionBehaviorFullScreenAuxiliary = 1 << 8
Foundation.invoke(_native, "setCollectionBehavior:", 1 << 8);
}
}
}
};
addWindowListener(macFullScreenPatchListener);
}
super.show();
}