/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
test
@bug 4868278
@summary Tests that GraphicsConfig for invisible (peerless) window is
updated after showing the window
@author artem.ananiev, area=awt.multiscreen
@library ../../regtesthelpers
@build Util
@run applet WindowGCChangeTest.html
*/
{
public void init()
{
}
public void start()
{
try
{
}
catch (Exception z)
{
throw new RuntimeException("Test FAILED: couldn't create Robot instance", z);
}
setVisible(true);
validate();
// check 2-screens systems only
{
return;
}
int defGDNo = 0;
int nondefGDNo = 0;
boolean isVirtualScreen = false;
{
if ((r.x != 0) || (r.y != 0))
{
isVirtualScreen = true;
}
{
defGDNo = i;
}
else
{
nondefGDNo = i;
}
}
// doesn't test separate screens
if (!isVirtualScreen)
{
return;
}
f.addWindowListener(new WindowAdapter()
{
{
{
throw new RuntimeException("Test FAILED: graphics config is not updated");
}
f.dispose();
}
});
f.setVisible(true);
// paranoia - change def to nondef and vice versa
g.addWindowListener(new WindowAdapter()
{
{
{
throw new RuntimeException("Test FAILED: graphics config is not updated");
}
g.dispose();
}
});
g.setVisible(true);
// test fullscreen changes
h.addWindowListener(new WindowAdapter()
{
{
{
throw new RuntimeException("Test FAILED: graphics config is not updated");
}
h.dispose();
}
});
h.setUndecorated(true);
}
}