JBR-1412 [fwp to JBR11] JBR-1393 RubyMine is hanging after log in (macOS)

Modified version of JBR8 fix

(cherry picked from commit 434166fe63)
This commit is contained in:
Alexey Ushakov
2019-05-07 14:35:11 +03:00
committed by alexey.ushakov@jetbrains.com
parent 03c0d4f1e3
commit edd181bf41

View File

@@ -1227,8 +1227,15 @@ public class RepaintManager
GraphicsConfiguration gc = gd.getDefaultConfiguration();
virtualBounds = virtualBounds.union(gc.getBounds());
}
doubleBufferMaxSize = new Dimension(virtualBounds.width,
virtualBounds.height);
doubleBufferMaxSize =
// Sometimes underlying desktop environment reports
// incorrect gc bounds (w=0,h=0). Replace them with
// maximum values (as we do for headless mode)
new Dimension(
virtualBounds.width == 0 ?
Integer.MAX_VALUE : virtualBounds.width,
virtualBounds.height == 0 ?
Integer.MAX_VALUE : virtualBounds.height);
} catch (HeadlessException e) {
doubleBufferMaxSize = new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
}