IDEA-94602 IDEA window is incorrectly repainted after automatic window resizing in Windows 7

This commit is contained in:
Vassiliy.Kudryashov
2015-09-08 21:14:09 +03:00
parent a4197eac2b
commit e4647dadff
@@ -37,10 +37,7 @@ import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.project.DumbAwareRunnable;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.wm.IdeFrame;
import com.intellij.openapi.wm.IdeRootPaneNorthExtension;
@@ -53,6 +50,7 @@ import com.intellij.openapi.wm.impl.status.*;
import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeFrame;
import com.intellij.ui.*;
import com.intellij.ui.mac.MacMainFrameDecorator;
import com.intellij.util.Alarm;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -136,6 +134,25 @@ public class IdeFrameImpl extends JFrame implements IdeFrameEx, DataProvider {
}
};
Toolkit.getDefaultToolkit().addPropertyChangeListener("win.xpstyle.themeActive", myWindowsBorderUpdater);
if (!SystemInfo.isJavaVersionAtLeast("1.8")) {
final Ref<Dimension> myDimensionRef = new Ref<Dimension>(new Dimension());
final Alarm alarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
final Runnable runnable = new Runnable() {
@Override
public void run() {
if (isDisplayable() && !getSize().equals(myDimensionRef.get())) {
Rectangle bounds = getBounds();
bounds.width--;
setBounds(bounds);
bounds.width++;
setBounds(bounds);
myDimensionRef.set(getSize());
}
alarm.addRequest(this, 50);
}
};
alarm.addRequest(runnable, 50);
}
}
IdeMenuBar.installAppMenuIfNeeded(this);