--- old/src/java.desktop/share/classes/java/awt/Toolkit.java 2015-09-23 21:36:56.000000000 +0300 +++ new/src/java.desktop/share/classes/java/awt/Toolkit.java 2015-09-23 21:36:56.000000000 +0300 @@ -208,11 +208,13 @@ } /** - * Returns whether dynamic layout of Containers on resize is - * currently active (both set in program - *( {@code isDynamicLayoutSet()} ) - *, and supported - * by the underlying operating system and/or window manager). + * Returns whether dynamic layout of Containers on resize is currently + * active (both set in program ({@code isDynamicLayoutSet()}), and supported + * by the underlying operating system and/or window manager). Note that on + * platforms where dynamic layout during resizing is not supported (or is + * always supported) by the OS/WM, ({@code isDynamicLayoutSet()}) property + * has no effect. + *

* If dynamic layout is currently inactive then Containers * re-layout their components when resizing is completed. As a result * the {@code Component.validate()} method will be invoked only --- old/test/java/awt/Toolkit/DynamicLayout/bug7172833.java 2015-09-23 21:36:57.000000000 +0300 +++ new/test/java/awt/Toolkit/DynamicLayout/bug7172833.java 2015-09-23 21:36:56.000000000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,16 +45,34 @@ public static void main(final String[] args) throws Exception { final StubbedToolkit t = new StubbedToolkit(); - + final Boolean dynamicLayoutSupported + = (Boolean) t.getDesktopProperty("awt.dynamicLayoutSupported"); t.setDynamicLayout(true); if(!t.isDynamicLayoutSet()){ throw new RuntimeException("'true' expected but 'false' returned"); } + if (dynamicLayoutSupported) { + if (!t.isDynamicLayoutActive()) { + throw new RuntimeException("is inactive but set+supported"); + } + } else { + if (t.isDynamicLayoutActive()) { + throw new RuntimeException("is active but unsupported"); + } + } t.setDynamicLayout(false); if(t.isDynamicLayoutSet()){ throw new RuntimeException("'false' expected but 'true' returned"); } + if (dynamicLayoutSupported) { + // Layout is supported and was set to false, cannot verifym because + // the native system is free to ignore our request. + } else { + if (t.isDynamicLayoutActive()) { + throw new RuntimeException("is active but unset+unsupported"); + } + } } static final class StubbedToolkit extends Toolkit {