8198002: java/awt/Mixing/Validating.java debug assert on Windows

Reviewed-by: serb, kaddepalli
This commit is contained in:
Ambarish Rapte 2018-11-09 18:35:25 +05:30
parent 3ec1c6f949
commit bc3c7c9b32
2 changed files with 15 additions and 8 deletions
src/java.desktop/windows/native/libawt/windows
test/jdk/java/awt/Mixing

@ -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 @@ void AwtFrame::Reshape(int x, int y, int width, int height)
// 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);

@ -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