Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
95137105
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,发现更多精彩内容 >>
提交
95137105
编写于
7月 27, 2009
作者:
D
dcherepanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6856929: Frame is not getting resized using Robot in OpenSolaris and Ubuntu
Reviewed-by: art, dav
上级
f80cbd95
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
14 deletion
+13
-14
src/solaris/classes/sun/awt/X11/XRobotPeer.java
src/solaris/classes/sun/awt/X11/XRobotPeer.java
+4
-2
src/solaris/native/sun/awt/awt_Robot.c
src/solaris/native/sun/awt/awt_Robot.c
+9
-12
未找到文件。
src/solaris/classes/sun/awt/X11/XRobotPeer.java
浏览文件 @
95137105
...
...
@@ -27,6 +27,7 @@ package sun.awt.X11;
import
java.awt.*
;
import
java.awt.peer.*
;
import
sun.awt.X11GraphicsConfig
;
import
sun.awt.SunToolkit
;
class
XRobotPeer
implements
RobotPeer
{
private
X11GraphicsConfig
xgc
=
null
;
...
...
@@ -38,7 +39,8 @@ class XRobotPeer implements RobotPeer {
XRobotPeer
(
GraphicsConfiguration
gc
)
{
this
.
xgc
=
(
X11GraphicsConfig
)
gc
;
setup
();
SunToolkit
tk
=
(
SunToolkit
)
Toolkit
.
getDefaultToolkit
();
setup
(
tk
.
getNumberOfButtons
());
}
public
void
dispose
()
{
...
...
@@ -81,7 +83,7 @@ class XRobotPeer implements RobotPeer {
return
pixelArray
;
}
private
static
native
synchronized
void
setup
();
private
static
native
synchronized
void
setup
(
int
numberOfButtons
);
private
static
native
synchronized
void
mouseMoveImpl
(
X11GraphicsConfig
xgc
,
int
x
,
int
y
);
private
static
native
synchronized
void
mousePressImpl
(
int
buttons
);
...
...
src/solaris/native/sun/awt/awt_Robot.c
浏览文件 @
95137105
...
...
@@ -51,9 +51,8 @@
extern
struct
X11GraphicsConfigIDs
x11GraphicsConfigIDs
;
extern
int32_t
getNumButtons
();
static
jint
*
masks
;
static
jint
num_buttons
;
static
int32_t
isXTestAvailable
()
{
int32_t
major_opcode
,
first_event
,
first_error
;
...
...
@@ -164,34 +163,34 @@ static XImage *getWindowImage(Display * display, Window window,
/*********************************************************************************************/
// this should be called from XRobotPeer constructor
JNIEXPORT
void
JNICALL
Java_sun_awt_X11_XRobotPeer_setup
(
JNIEnv
*
env
,
jclass
cls
)
{
Java_sun_awt_X11_XRobotPeer_setup
(
JNIEnv
*
env
,
jclass
cls
,
jint
numberOfButtons
)
{
int32_t
xtestAvailable
;
// this should be called from XRobotPeer constructor
DTRACE_PRINTLN
(
"RobotPeer: setup()"
);
num_buttons
=
numberOfButtons
;
jclass
inputEventClazz
=
(
*
env
)
->
FindClass
(
env
,
"java/awt/event/InputEvent"
);
jmethodID
getButtonDownMasksID
=
(
*
env
)
->
GetStaticMethodID
(
env
,
inputEventClazz
,
"getButtonDownMasks"
,
"()[I"
);
jintArray
obj
=
(
jintArray
)(
*
env
)
->
CallStaticObjectMethod
(
env
,
inputEventClazz
,
getButtonDownMasksID
);
jsize
len
=
(
*
env
)
->
GetArrayLength
(
env
,
obj
);
jint
*
tmp
=
(
*
env
)
->
GetIntArrayElements
(
env
,
obj
,
JNI_FALSE
);
masks
=
(
jint
*
)
malloc
(
sizeof
(
jint
)
*
len
);
masks
=
(
jint
*
)
malloc
(
sizeof
(
jint
)
*
num_buttons
);
if
(
masks
==
(
jint
*
)
NULL
)
{
JNU_ThrowOutOfMemoryError
((
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
),
NULL
);
goto
finally
;
}
int
i
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
num_buttons
;
i
++
)
{
masks
[
i
]
=
tmp
[
i
];
}
(
*
env
)
->
ReleaseIntArrayElements
(
env
,
obj
,
tmp
,
0
);
(
*
env
)
->
DeleteLocalRef
(
env
,
obj
);
DTRACE_PRINTLN
(
"RobotPeer: setup()"
);
AWT_LOCK
();
xtestAvailable
=
isXTestAvailable
();
DTRACE_PRINTLN1
(
"RobotPeer: XTest available = %d"
,
xtestAvailable
);
if
(
!
xtestAvailable
)
{
...
...
@@ -338,8 +337,6 @@ void mouseAction(JNIEnv *env,
{
AWT_LOCK
();
int32_t
num_buttons
=
getNumButtons
();
//from XToolkit.c
DTRACE_PRINTLN1
(
"RobotPeer: mouseAction(%i)"
,
buttonMask
);
DTRACE_PRINTLN1
(
"RobotPeer: mouseAction, press = %d"
,
isMousePress
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录