From c7efe3208d7335052326b76e0245407a96d32438 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 13 Dec 2011 18:13:27 +0100 Subject: [PATCH] restore maximized frame state on ubuntu unity --- .../com/intellij/openapi/wm/impl/WindowManagerImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowManagerImpl.java index 7cb9c3e23c27..f3120595d01d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowManagerImpl.java @@ -236,8 +236,8 @@ public final class WindowManagerImpl extends WindowManagerEx implements Applicat } frame.setBounds(myFrameBounds); - frame.setVisible(true); frame.setExtendedState(myFrameExtendedState); + frame.setVisible(true); } public IdeFrameImpl[] getAllFrames() { @@ -712,13 +712,15 @@ public final class WindowManagerImpl extends WindowManagerEx implements Applicat final IdeFrameImpl frame = getFrame(project); if (frame != null) { - boolean usePreviousBounds = SystemInfo.isMacOSLion && WindowManagerEx.getInstanceEx().isFullScreen(frame); + int extendedState = frame.getExtendedState(); + boolean usePreviousBounds = extendedState == Frame.MAXIMIZED_BOTH || + SystemInfo.isMacOSLion && WindowManagerEx.getInstanceEx().isFullScreen(frame); final Rectangle rectangle = usePreviousBounds ? myFrameBounds : frame.getBounds(); frameElement.setAttribute(X_ATTR, Integer.toString(rectangle.x)); frameElement.setAttribute(Y_ATTR, Integer.toString(rectangle.y)); frameElement.setAttribute(WIDTH_ATTR, Integer.toString(rectangle.width)); frameElement.setAttribute(HEIGHT_ATTR, Integer.toString(rectangle.height)); - frameElement.setAttribute(EXTENDED_STATE_ATTR, Integer.toString(frame.getExtendedState())); + frameElement.setAttribute(EXTENDED_STATE_ATTR, Integer.toString(extendedState)); // Save default layout final Element layoutElement = new Element(DesktopLayout.TAG);