Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
e5f431d0
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e5f431d0
编写于
7月 11, 2013
作者:
P
pchelko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8020210: [macosx] JVM crashes in CWrapper$NSWindow.screen(long)
Reviewed-by: anthony, art
上级
1466a855
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
76 addition
and
132 deletion
+76
-132
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+9
-13
src/macosx/classes/sun/lwawt/macosx/CWrapper.java
src/macosx/classes/sun/lwawt/macosx/CWrapper.java
+0
-8
src/macosx/native/sun/awt/CWrapper.m
src/macosx/native/sun/awt/CWrapper.m
+0
-111
test/java/awt/Window/MaximizeOffscreen/MaximizeOffscreenTest.java
...a/awt/Window/MaximizeOffscreen/MaximizeOffscreenTest.java
+67
-0
未找到文件。
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
浏览文件 @
e5f431d0
...
@@ -479,12 +479,14 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
...
@@ -479,12 +479,14 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
deliverZoom
(
true
);
deliverZoom
(
true
);
this
.
normalBounds
=
peer
.
getBounds
();
this
.
normalBounds
=
peer
.
getBounds
();
long
screen
=
CWrapper
.
NSWindow
.
screen
(
getNSWindowPtr
());
Rectangle
toBounds
=
CWrapper
.
NSScreen
.
visibleFrame
(
screen
).
getBounds
();
GraphicsConfiguration
config
=
getPeer
().
getGraphicsConfiguration
();
// Flip the y coordinate
Insets
i
=
((
CGraphicsDevice
)
config
.
getDevice
()).
getScreenInsets
();
Rectangle
frame
=
CWrapper
.
NSScreen
.
frame
(
screen
).
getBounds
();
Rectangle
toBounds
=
config
.
getBounds
();
toBounds
.
y
=
frame
.
height
-
toBounds
.
y
-
toBounds
.
height
;
setBounds
(
toBounds
.
x
+
i
.
left
,
setBounds
(
toBounds
.
x
,
toBounds
.
y
,
toBounds
.
width
,
toBounds
.
height
);
toBounds
.
y
+
i
.
top
,
toBounds
.
width
-
i
.
left
-
i
.
right
,
toBounds
.
height
-
i
.
top
-
i
.
bottom
);
}
}
}
}
...
@@ -751,13 +753,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
...
@@ -751,13 +753,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
// the move/size notification from the underlying system comes
// the move/size notification from the underlying system comes
// but it contains a bounds smaller than the whole screen
// but it contains a bounds smaller than the whole screen
// and therefore we need to create the synthetic notifications
// and therefore we need to create the synthetic notifications
Rectangle
screenBounds
;
Rectangle
screenBounds
=
getPeer
().
getGraphicsConfiguration
().
getBounds
();
final
long
screenPtr
=
CWrapper
.
NSWindow
.
screen
(
getNSWindowPtr
());
try
{
screenBounds
=
CWrapper
.
NSScreen
.
frame
(
screenPtr
).
getBounds
();
}
finally
{
CWrapper
.
NSObject
.
release
(
screenPtr
);
}
peer
.
notifyReshape
(
screenBounds
.
x
,
screenBounds
.
y
,
screenBounds
.
width
,
peer
.
notifyReshape
(
screenBounds
.
x
,
screenBounds
.
y
,
screenBounds
.
width
,
screenBounds
.
height
);
screenBounds
.
height
);
}
}
...
...
src/macosx/classes/sun/lwawt/macosx/CWrapper.java
浏览文件 @
e5f431d0
...
@@ -71,8 +71,6 @@ public final class CWrapper {
...
@@ -71,8 +71,6 @@ public final class CWrapper {
public
static
native
void
zoom
(
long
window
);
public
static
native
void
zoom
(
long
window
);
public
static
native
void
makeFirstResponder
(
long
window
,
long
responder
);
public
static
native
void
makeFirstResponder
(
long
window
,
long
responder
);
public
static
native
long
screen
(
long
window
);
}
}
public
static
final
class
NSView
{
public
static
final
class
NSView
{
...
@@ -95,12 +93,6 @@ public final class CWrapper {
...
@@ -95,12 +93,6 @@ public final class CWrapper {
public
static
native
void
release
(
long
object
);
public
static
native
void
release
(
long
object
);
}
}
public
static
final
class
NSScreen
{
public
static
native
Rectangle2D
frame
(
long
screen
);
public
static
native
Rectangle2D
visibleFrame
(
long
screen
);
public
static
native
long
screenByDisplayId
(
int
displayID
);
}
public
static
final
class
NSColor
{
public
static
final
class
NSColor
{
public
static
native
long
clearColor
();
public
static
native
long
clearColor
();
}
}
...
...
src/macosx/native/sun/awt/CWrapper.m
浏览文件 @
e5f431d0
...
@@ -396,31 +396,6 @@ JNF_COCOA_ENTER(env);
...
@@ -396,31 +396,6 @@ JNF_COCOA_ENTER(env);
JNF_COCOA_EXIT
(
env
);
JNF_COCOA_EXIT
(
env
);
}
}
/*
* Class: sun_lwawt_macosx_CWrapper$NSWindow
* Method: screen
* Signature: (J)J
*/
JNIEXPORT
jlong
JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_screen
(
JNIEnv
*
env
,
jclass
cls
,
jlong
windowPtr
)
{
__block
jlong
screenPtr
=
0L
;
JNF_COCOA_ENTER
(
env
);
AWTWindow
*
window
=
(
AWTWindow
*
)
jlong_to_ptr
(
windowPtr
);
[
ThreadUtilities
performOnMainThreadWaiting
:
YES
block
:
^
(){
const
NSScreen
*
screen
=
[
window
screen
];
CFRetain
(
screen
);
// GC
screenPtr
=
ptr_to_jlong
(
screen
);
}];
JNF_COCOA_EXIT
(
env
);
return
screenPtr
;
}
/
*
/
*
*
Method:
miniaturize
*
Method:
miniaturize
*
Signature:
(
J
)
V
*
Signature:
(
J
)
V
...
@@ -690,92 +665,6 @@ JNF_COCOA_ENTER(env);
...
@@ -690,92 +665,6 @@ JNF_COCOA_ENTER(env);
JNF_COCOA_EXIT
(
env
);
JNF_COCOA_EXIT
(
env
);
}
}
/*
* Class: sun_lwawt_macosx_CWrapper$NSScreen
* Method: frame
* Signature: (J)Ljava/awt/Rectangle;
*/
JNIEXPORT
jobject
JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSScreen_frame
(
JNIEnv
*
env
,
jclass
cls
,
jlong
screenPtr
)
{
jobject
jRect
=
NULL
;
JNF_COCOA_ENTER
(
env
);
__block
NSRect
rect
=
NSZeroRect
;
NSScreen
*
screen
=
(
NSScreen
*
)
jlong_to_ptr
(
screenPtr
);
[
ThreadUtilities
performOnMainThreadWaiting
:
YES
block
:
^
(){
rect
=
[
screen
frame
];
}];
jRect
=
NSToJavaRect
(
env
,
rect
);
JNF_COCOA_EXIT
(
env
);
return
jRect
;
}
/*
* Class: sun_lwawt_macosx_CWrapper_NSScreen
* Method: visibleFrame
* Signature: (J)Ljava/awt/geom/Rectangle2D;
*/
JNIEXPORT
jobject
JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSScreen_visibleFrame
(
JNIEnv
*
env
,
jclass
cls
,
jlong
screenPtr
)
{
jobject
jRect
=
NULL
;
JNF_COCOA_ENTER
(
env
);
__block
NSRect
rect
=
NSZeroRect
;
NSScreen
*
screen
=
(
NSScreen
*
)
jlong_to_ptr
(
screenPtr
);
[
ThreadUtilities
performOnMainThreadWaiting
:
YES
block
:
^
(){
rect
=
[
screen
visibleFrame
];
}];
jRect
=
NSToJavaRect
(
env
,
rect
);
JNF_COCOA_EXIT
(
env
);
return
jRect
;
}
/*
* Class: sun_lwawt_macosx_CWrapper_NSScreen
* Method: screenByDisplayId
* Signature: (J)J
*/
JNIEXPORT
jlong
JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSScreen_screenByDisplayId
(
JNIEnv
*
env
,
jclass
cls
,
jint
displayID
)
{
__block
jlong
screenPtr
=
0L
;
JNF_COCOA_ENTER
(
env
);
[
ThreadUtilities
performOnMainThreadWaiting
:
YES
block
:
^
(){
NSArray
*
screens
=
[
NSScreen
screens
];
for
(
NSScreen
*
screen
in
screens
)
{
NSDictionary
*
screenInfo
=
[
screen
deviceDescription
];
NSNumber
*
screenID
=
[
screenInfo
objectForKey
:
@"NSScreenNumber"
];
if
([
screenID
intValue
]
==
displayID
){
CFRetain
(
screen
);
// GC
screenPtr
=
ptr_to_jlong
(
screen
);
break
;
}
}
}];
JNF_COCOA_EXIT
(
env
);
return
screenPtr
;
}
/
*
/
*
*
Class:
sun_lwawt_macosx_CWrapper
$
NSColor
*
Class:
sun_lwawt_macosx_CWrapper
$
NSColor
*
Method:
clearColor
*
Method:
clearColor
...
...
test/java/awt/Window/MaximizeOffscreen/MaximizeOffscreenTest.java
0 → 100644
浏览文件 @
e5f431d0
/*
* Copyright (c) 2013, 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.
*/
/**
* @test @summary JVM crash if the frame maximized from offscreen
* @author Petr Pchelko
* @library ../../regtesthelpers
* @build Util
* @compile MaximizeOffscreenTest.java
* @run main/othervm MaximizeOffscreenTest
*/
import
test.java.awt.regtesthelpers.Util
;
import
javax.swing.*
;
import
java.awt.*
;
public
class
MaximizeOffscreenTest
{
private
static
JFrame
frame
;
public
static
void
main
(
String
[]
args
)
throws
Throwable
{
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
@Override
public
void
run
()
{
constructTestUI
();
}
});
Util
.
waitForIdle
(
null
);
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
@Override
public
void
run
()
{
frame
.
setExtendedState
(
Frame
.
MAXIMIZED_BOTH
);
}
});
Util
.
waitForIdle
(
null
);
}
private
static
void
constructTestUI
()
{
frame
=
new
JFrame
(
"Test frame"
);
frame
.
setUndecorated
(
true
);
frame
.
setBounds
(-
1000
,
-
1000
,
100
,
100
);
frame
.
setVisible
(
true
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录