Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
67a01dda
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
67a01dda
编写于
2月 28, 2013
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8003169: [macosx] JVM crash after disconnecting from projector
Reviewed-by: anthony, alexsch
上级
7ace10d5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
60 addition
and
25 deletion
+60
-25
src/macosx/classes/sun/awt/CGraphicsDevice.java
src/macosx/classes/sun/awt/CGraphicsDevice.java
+14
-6
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
+2
-17
src/macosx/native/sun/awt/CGraphicsDevice.m
src/macosx/native/sun/awt/CGraphicsDevice.m
+44
-2
未找到文件。
src/macosx/classes/sun/awt/CGraphicsDevice.java
浏览文件 @
67a01dda
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012,
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
...
...
@@ -29,6 +29,7 @@ import java.awt.AWTPermission;
import
java.awt.DisplayMode
;
import
java.awt.GraphicsConfiguration
;
import
java.awt.GraphicsDevice
;
import
java.awt.Insets
;
import
java.awt.Window
;
import
java.util.Objects
;
...
...
@@ -110,8 +111,9 @@ public final class CGraphicsDevice extends GraphicsDevice {
return
nativeGetYResolution
(
displayID
);
}
private
static
native
double
nativeGetXResolution
(
int
displayID
);
private
static
native
double
nativeGetYResolution
(
int
displayID
);
public
Insets
getScreenInsets
()
{
return
nativeGetScreenInsets
(
displayID
);
}
/**
* Enters full-screen mode, or returns to windowed mode.
...
...
@@ -217,9 +219,15 @@ public final class CGraphicsDevice extends GraphicsDevice {
return
nativeGetDisplayModes
(
displayID
);
}
private
native
void
nativeSetDisplayMode
(
int
displayID
,
int
w
,
int
h
,
int
bpp
,
int
refrate
);
private
static
native
void
nativeSetDisplayMode
(
int
displayID
,
int
w
,
int
h
,
int
bpp
,
int
refrate
);
private
static
native
DisplayMode
nativeGetDisplayMode
(
int
displayID
);
private
native
DisplayMode
nativeGetDisplayMode
(
int
displayID
);
private
static
native
DisplayMode
[]
nativeGetDisplayModes
(
int
displayID
);
private
static
native
double
nativeGetXResolution
(
int
displayID
);
private
static
native
double
nativeGetYResolution
(
int
displayID
);
private
native
DisplayMode
[]
nativeGetDisplayMode
s
(
int
displayID
);
private
static
native
Insets
nativeGetScreenInset
s
(
int
displayID
);
}
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
浏览文件 @
67a01dda
/*
* Copyright (c) 2011, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 201
3
, 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
...
...
@@ -351,22 +351,7 @@ public final class LWCToolkit extends LWToolkit {
@Override
public
Insets
getScreenInsets
(
final
GraphicsConfiguration
gc
)
{
final
CGraphicsConfig
cgc
=
(
CGraphicsConfig
)
gc
;
final
int
displayId
=
cgc
.
getDevice
().
getCGDisplayID
();
Rectangle
fullScreen
,
workArea
;
final
long
screen
=
CWrapper
.
NSScreen
.
screenByDisplayId
(
displayId
);
try
{
fullScreen
=
CWrapper
.
NSScreen
.
frame
(
screen
).
getBounds
();
workArea
=
CWrapper
.
NSScreen
.
visibleFrame
(
screen
).
getBounds
();
}
finally
{
CWrapper
.
NSObject
.
release
(
screen
);
}
// Convert between Cocoa's coordinate system and Java.
int
bottom
=
workArea
.
y
-
fullScreen
.
y
;
int
top
=
fullScreen
.
height
-
workArea
.
height
-
bottom
;
int
left
=
workArea
.
x
-
fullScreen
.
x
;
int
right
=
fullScreen
.
width
-
workArea
.
width
-
left
;
return
new
Insets
(
top
,
left
,
bottom
,
right
);
return
((
CGraphicsConfig
)
gc
).
getDevice
().
getScreenInsets
();
}
@Override
...
...
src/macosx/native/sun/awt/CGraphicsDevice.m
浏览文件 @
67a01dda
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012,
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
...
...
@@ -23,7 +23,8 @@
* questions.
*/
#include "LWCToolkit.h"
#import "LWCToolkit.h"
#import "ThreadUtilities.h"
/*
* Convert the mode string to the more convinient bits per pixel value
...
...
@@ -146,6 +147,47 @@ Java_sun_awt_CGraphicsDevice_nativeGetYResolution
return
dpi
;
}
/*
* Class: sun_awt_CGraphicsDevice
* Method: nativeGetScreenInsets
* Signature: (I)D
*/
JNIEXPORT
jobject
JNICALL
Java_sun_awt_CGraphicsDevice_nativeGetScreenInsets
(
JNIEnv
*
env
,
jclass
class
,
jint
displayID
)
{
jobject
ret
=
NULL
;
__block
NSRect
frame
=
NSZeroRect
;
__block
NSRect
visibleFrame
=
NSZeroRect
;
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
pointerValue
]
==
displayID
){
frame
=
[
screen
frame
];
visibleFrame
=
[
screen
visibleFrame
];
break
;
}
}
}];
// Convert between Cocoa's coordinate system and Java.
jint
bottom
=
visibleFrame
.
origin
.
y
-
frame
.
origin
.
y
;
jint
top
=
frame
.
size
.
height
-
visibleFrame
.
size
.
height
-
bottom
;
jint
left
=
visibleFrame
.
origin
.
x
-
frame
.
origin
.
x
;
jint
right
=
frame
.
size
.
width
-
visibleFrame
.
size
.
width
-
left
;
static
JNF_CLASS_CACHE
(
jc_Insets
,
"java/awt/Insets"
);
static
JNF_CTOR_CACHE
(
jc_Insets_ctor
,
jc_Insets
,
"(IIII)V"
);
ret
=
JNFNewObject
(
env
,
jc_Insets_ctor
,
top
,
left
,
bottom
,
right
);
JNF_COCOA_EXIT
(
env
);
return
ret
;
}
/*
* Class: sun_awt_CGraphicsDevice
* Method: nativeSetDisplayMode
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录