Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
87452bfe
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
87452bfe
编写于
2月 13, 2020
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8221823: Requested JDialog width is ignored
Reviewed-by: aivanov
上级
764187ea
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
166 addition
and
25 deletion
+166
-25
src/java.desktop/windows/classes/sun/awt/windows/WDialogPeer.java
....desktop/windows/classes/sun/awt/windows/WDialogPeer.java
+13
-7
src/java.desktop/windows/classes/sun/awt/windows/WFramePeer.java
...a.desktop/windows/classes/sun/awt/windows/WFramePeer.java
+4
-3
src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java
....desktop/windows/classes/sun/awt/windows/WWindowPeer.java
+19
-5
src/java.desktop/windows/native/libawt/windows/awt_Window.cpp
...java.desktop/windows/native/libawt/windows/awt_Window.cpp
+5
-5
test/jdk/ProblemList.txt
test/jdk/ProblemList.txt
+0
-2
test/jdk/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java
.../Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java
+1
-1
test/jdk/java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java
test/jdk/java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java
+1
-1
test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java
.../jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java
+1
-1
test/jdk/java/awt/Window/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java
...ndow/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java
+122
-0
未找到文件。
src/java.desktop/windows/classes/sun/awt/windows/WDialogPeer.java
浏览文件 @
87452bfe
/*
* Copyright (c) 1996, 20
14
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 20
20
, 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
...
...
@@ -22,13 +22,19 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
sun.awt.windows
;
import
java.awt.*
;
import
java.awt.peer.*
;
import
java.awt.Color
;
import
java.awt.Component
;
import
java.awt.Dialog
;
import
java.awt.Dimension
;
import
java.awt.SystemColor
;
import
java.awt.Window
;
import
java.awt.peer.DialogPeer
;
import
sun.awt.
*
;
import
sun.awt.im.
*
;
import
sun.awt.
AWTAccessor
;
import
sun.awt.im.
InputMethodManager
;
final
class
WDialogPeer
extends
WWindowPeer
implements
DialogPeer
{
// Toolkit & peer internals
...
...
@@ -110,9 +116,9 @@ final class WDialogPeer extends WWindowPeer implements DialogPeer {
public
Dimension
getMinimumSize
()
{
if
(((
Dialog
)
target
).
isUndecorated
())
{
return
super
.
getMinimumSize
();
}
else
{
return
new
Dimension
(
getSysMinWidth
(),
getSysMinHeight
());
}
return
new
Dimension
(
scaleDownX
(
getSysMinWidth
()),
scaleDownY
(
getSysMinHeight
()));
}
@Override
...
...
src/java.desktop/windows/classes/sun/awt/windows/WFramePeer.java
浏览文件 @
87452bfe
...
...
@@ -147,13 +147,14 @@ class WFramePeer extends WWindowPeer implements FramePeer {
}
@Override
public
Dimension
getMinimumSize
()
{
public
final
Dimension
getMinimumSize
()
{
Dimension
d
=
new
Dimension
();
if
(!((
Frame
)
target
).
isUndecorated
())
{
d
.
setSize
(
getSysMinWidth
(),
getSysMinHeight
());
d
.
setSize
(
scaleDownX
(
getSysMinWidth
()),
scaleDownY
(
getSysMinHeight
()));
}
if
(((
Frame
)
target
).
getMenuBar
()
!=
null
)
{
d
.
height
+=
getSysMenuHeight
(
);
d
.
height
+=
scaleDownY
(
getSysMenuHeight
()
);
}
return
d
;
}
...
...
src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java
浏览文件 @
87452bfe
/*
* Copyright (c) 1996, 20
18
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 20
20
, 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
...
...
@@ -402,10 +402,8 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
minimumSize
=
((
Component
)
target
).
getMinimumSize
();
}
if
(
minimumSize
!=
null
)
{
int
msw
=
getSysMinWidth
();
int
msh
=
getSysMinHeight
();
int
w
=
(
minimumSize
.
width
>=
msw
)
?
minimumSize
.
width
:
msw
;
int
h
=
(
minimumSize
.
height
>=
msh
)
?
minimumSize
.
height
:
msh
;
int
w
=
Math
.
max
(
minimumSize
.
width
,
scaleDownX
(
getSysMinWidth
()));
int
h
=
Math
.
max
(
minimumSize
.
height
,
scaleDownY
(
getSysMinHeight
()));
setMinSize
(
w
,
h
);
}
else
{
setMinSize
(
0
,
0
);
...
...
@@ -687,6 +685,22 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
}
}
final
int
scaleUpX
(
int
x
)
{
return
Region
.
clipRound
(
x
*
scaleX
);
}
final
int
scaleUpY
(
int
y
)
{
return
Region
.
clipRound
(
y
*
scaleY
);
}
final
int
scaleDownX
(
int
x
)
{
return
Region
.
clipRound
(
x
/
scaleX
);
}
final
int
scaleDownY
(
int
y
)
{
return
Region
.
clipRound
(
y
/
scaleY
);
}
@Override
public
void
print
(
Graphics
g
)
{
// We assume we print the whole frame,
...
...
src/java.desktop/windows/native/libawt/windows/awt_Window.cpp
浏览文件 @
87452bfe
/*
* Copyright (c) 1996, 20
17
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 20
20
, 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
...
...
@@ -2565,8 +2565,8 @@ void AwtWindow::_ReshapeFrame(void *param)
if
(
!
p
->
IsEmbeddedFrame
())
{
jobject
peer
=
p
->
GetPeer
(
env
);
int
minWidth
=
::
GetSystemMetrics
(
SM_CXMIN
);
int
minHeight
=
::
GetSystemMetrics
(
SM_CYMIN
);
int
minWidth
=
p
->
ScaleDownX
(
::
GetSystemMetrics
(
SM_CXMIN
)
);
int
minHeight
=
p
->
ScaleDownY
(
::
GetSystemMetrics
(
SM_CYMIN
)
);
if
(
w
<
minWidth
)
{
env
->
SetIntField
(
target
,
AwtComponent
::
widthID
,
...
...
@@ -3857,7 +3857,7 @@ Java_sun_awt_windows_WWindowPeer_setOpacity(JNIEnv *env, jobject self,
os
->
iOpacity
=
iOpacity
;
AwtToolkit
::
GetInstance
().
SyncCall
(
AwtWindow
::
_SetOpacity
,
os
);
// global refs and mds are deleted in _Set
MinSize
// global refs and mds are deleted in _Set
Opacity
CATCH_BAD_ALLOC
;
}
...
...
@@ -3878,7 +3878,7 @@ Java_sun_awt_windows_WWindowPeer_setOpaqueImpl(JNIEnv *env, jobject self,
os
->
isOpaque
=
isOpaque
;
AwtToolkit
::
GetInstance
().
SyncCall
(
AwtWindow
::
_SetOpaque
,
os
);
// global refs and mds are deleted in _Set
MinSiz
e
// global refs and mds are deleted in _Set
Opaqu
e
CATCH_BAD_ALLOC
;
}
...
...
test/jdk/ProblemList.txt
浏览文件 @
87452bfe
...
...
@@ -517,8 +517,6 @@ com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java 8233648 macosx-all
java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java 7185258 macosx-all
java/awt/TrayIcon/RightClickWhenBalloonDisplayed/RightClickWhenBalloonDisplayed.java 8238720 windows-all
java/awt/PopupMenu/PopupMenuLocation.java 8238720 windows-all
java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java 8238720 windows-all
java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java 8238720 windows-all
java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java 8238720 windows-all
java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java 8238720 windows-all
java/awt/event/MouseEvent/FrameMouseEventAbsoluteCoordsTest/FrameMouseEventAbsoluteCoordsTest.java
...
...
test/jdk/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java
浏览文件 @
87452bfe
...
...
@@ -35,7 +35,7 @@ import java.io.*;
/*
* @test
* @key headful
* @bug 6768230
* @bug 6768230
8221823
* @summary Mixing test for HierarchyBoundsListener ancestors
* @build FrameBorderCounter
* @run main HierarchyBoundsListenerMixingTest
...
...
test/jdk/java/awt/Mixing/AWT_Mixing/MixingFrameResizing.java
浏览文件 @
87452bfe
...
...
@@ -39,7 +39,7 @@ import test.java.awt.regtesthelpers.Util;
/*
* @test
* @key headful
* @bug 6777370
* @bug 6777370
8221823
* @summary Issues when resizing the JFrame with HW components
* @author sergey.grinev@oracle.com: area=awt.mixing
* @library /java/awt/patchlib ../../regtesthelpers
...
...
test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java
浏览文件 @
87452bfe
...
...
@@ -35,7 +35,7 @@ import test.java.awt.regtesthelpers.Util;
/*
* @test
* @key headful
* @bug 6786219
* @bug 6786219
8221823
* @summary Issues when resizing the frame after mixing of heavy weight & light weight components
* @author sergey.grinev@oracle.com: area=awt.mixing
* @library ../../regtesthelpers
...
...
test/jdk/java/awt/Window/MinimumSizeDPIVariation/MinimumSizeDPIVariation.java
0 → 100644
浏览文件 @
87452bfe
/*
* Copyright (c) 2020, 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
* 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.
*/
import
java.awt.Dialog
;
import
java.awt.Dimension
;
import
java.awt.Frame
;
import
java.awt.Window
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
jdk.test.lib.Platform
;
import
jdk.test.lib.process.OutputAnalyzer
;
import
jdk.test.lib.process.ProcessTools
;
/**
* @test
* @bug 8221823
* @key headful
* @summary Verifies TOP level component's minimumSize using different DPI
* @library /test/lib
* @run main/othervm -Dsun.java2d.uiScale=1 MinimumSizeDPIVariation
*/
public
final
class
MinimumSizeDPIVariation
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
if
(
args
.
length
==
0
)
{
Dimension
minimumSize
=
test
(
new
Frame
());
checkAllDPI
(
"frame"
,
minimumSize
.
width
,
minimumSize
.
height
);
minimumSize
=
test
(
new
Window
(
null
));
checkAllDPI
(
"window"
,
minimumSize
.
width
,
minimumSize
.
height
);
minimumSize
=
test
(
new
Dialog
((
Frame
)
null
));
checkAllDPI
(
"dialog"
,
minimumSize
.
width
,
minimumSize
.
height
);
}
else
{
String
comp
=
args
[
0
];
int
w
=
Integer
.
parseInt
(
args
[
1
]);
int
h
=
Integer
.
parseInt
(
args
[
2
]);
double
scale
=
Double
.
parseDouble
(
args
[
3
]);
System
.
err
.
println
(
"comp = "
+
comp
);
System
.
err
.
println
(
"scale = "
+
scale
);
Dimension
minimumSize
=
null
;
switch
(
comp
)
{
case
"frame"
:
minimumSize
=
test
(
new
Frame
());
break
;
case
"window"
:
minimumSize
=
test
(
new
Window
(
null
));
break
;
case
"dialog"
:
minimumSize
=
test
(
new
Dialog
((
Frame
)
null
));
break
;
default
:
throw
new
java
.
lang
.
IllegalStateException
(
"Unexpected value: "
+
comp
);
};
check
(
minimumSize
.
width
,
Math
.
max
(
w
/
scale
,
1
));
check
(
minimumSize
.
height
,
Math
.
max
(
h
/
scale
,
1
));
}
}
private
static
Dimension
test
(
Window
window
)
{
try
{
window
.
setLayout
(
null
);
// trigger use the minimum size of the peer
window
.
setSize
(
new
Dimension
(
1
,
1
));
window
.
pack
();
Dimension
minimumSize
=
window
.
getMinimumSize
();
Dimension
size
=
window
.
getSize
();
if
(!
minimumSize
.
equals
(
size
))
{
System
.
err
.
println
(
window
);
System
.
err
.
println
(
"Expected: "
+
minimumSize
);
System
.
err
.
println
(
"Actual: "
+
size
);
throw
new
RuntimeException
(
"Wrong size"
);
}
return
minimumSize
;
}
finally
{
window
.
dispose
();
}
}
private
static
void
check
(
int
actual
,
double
expected
)
{
double
i
=
100
*
(
actual
-
expected
)
/
expected
;
if
(
Math
.
abs
(
i
)
>
10
)
{
// no more than 10% variation
System
.
err
.
println
(
"Expected: "
+
expected
);
System
.
err
.
println
(
"Actual: "
+
actual
);
throw
new
RuntimeException
(
"Difference is too big: "
+
i
);
}
}
private
static
void
checkAllDPI
(
String
comp
,
int
w
,
int
h
)
throws
Exception
{
if
(!
Platform
.
isOSX
())
{
for
(
String
dpi
:
List
.
of
(
"1.5"
,
"1.75"
,
"2"
,
"2.5"
))
{
runPocess
(
dpi
,
comp
,
w
,
h
);
}
}
}
private
static
void
runPocess
(
String
dpi
,
String
comp
,
int
w
,
int
h
)
throws
Exception
{
ProcessBuilder
pb
=
ProcessTools
.
createJavaProcessBuilder
(
"-Dsun.java2d.uiScale="
+
dpi
,
MinimumSizeDPIVariation
.
class
.
getSimpleName
(),
comp
,
String
.
valueOf
(
w
),
String
.
valueOf
(
h
),
dpi
);
Process
worker
=
ProcessTools
.
startProcess
(
"Worker"
,
pb
,
null
,
20
,
TimeUnit
.
SECONDS
);
new
OutputAnalyzer
(
worker
).
shouldHaveExitValue
(
0
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录