# HG changeset patch # User arapte # Date 1541768725 -19800 # Node ID e944ea36af052ffae105fc02aa1cee19b1dde333 # Parent c1389b2371c9d04215b7571c327a5543f78d8564 8198002: java/awt/Mixing/Validating.java debug assert on Windows Reviewed-by: serb, kaddepalli diff -r c1389b2371c9 -r e944ea36af05 src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp --- a/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp Fri Nov 09 12:08:05 2018 +0530 +++ b/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp Fri Nov 09 18:35:25 2018 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, 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 @@ -699,10 +699,13 @@ // maximized state bit (matches Motif behaviour) // (calling ShowWindow(SW_RESTORE) would fire an // activation event which we don't want) - LONG style = GetStyle(); - DASSERT(style & WS_MAXIMIZE); - style ^= WS_MAXIMIZE; - SetStyle(style); + HWND hWnd = GetHWnd(); + if (hWnd != NULL && ::IsWindowVisible(hWnd)) { + LONG style = GetStyle(); + DASSERT(style & WS_MAXIMIZE); + style ^= WS_MAXIMIZE; + SetStyle(style); + } } AwtWindow::Reshape(x, y, width, height); diff -r c1389b2371c9 -r e944ea36af05 test/jdk/java/awt/Mixing/Validating.java --- a/test/jdk/java/awt/Mixing/Validating.java Fri Nov 09 12:08:05 2018 +0530 +++ b/test/jdk/java/awt/Mixing/Validating.java Fri Nov 09 18:35:25 2018 +0530 @@ -24,7 +24,7 @@ /* @test @key headful - @bug 6682046 + @bug 6682046 8198002 @summary Mixing code does not always recalculate shapes correctly when resizing components @author anthony.petrov@...: area=awt.mixing @library ../regtesthelpers @@ -38,8 +38,12 @@ * summary: Mixing code does not always recalculate shapes correctly when resizing components */ -import java.awt.*; -import java.awt.event.*; +import java.awt.Button; +import java.awt.event.InputEvent; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Toolkit; import test.java.awt.regtesthelpers.Util; public class Validating