8198002: java/awt/Mixing/Validating.java debug assert on Windows
Reviewed-by: serb, kaddepalli
--- 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);
--- 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