Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
cae87d11
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cae87d11
编写于
6月 26, 2009
作者:
Y
yan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6711676: Numpad keys trigger more than one KeyEvent.
Summary: Introduce a new sniffer based on server keymap. Reviewed-by: art
上级
ed0fdf46
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
55 addition
and
27 deletion
+55
-27
make/sun/xawt/mapfile-vers
make/sun/xawt/mapfile-vers
+1
-0
src/solaris/classes/sun/awt/X11/XKeysym.java
src/solaris/classes/sun/awt/X11/XKeysym.java
+2
-2
src/solaris/classes/sun/awt/X11/XToolkit.java
src/solaris/classes/sun/awt/X11/XToolkit.java
+17
-23
src/solaris/classes/sun/awt/X11/XlibWrapper.java
src/solaris/classes/sun/awt/X11/XlibWrapper.java
+1
-0
src/solaris/classes/sun/awt/X11/keysym2ucs.h
src/solaris/classes/sun/awt/X11/keysym2ucs.h
+2
-2
src/solaris/native/sun/xawt/XlibWrapper.c
src/solaris/native/sun/xawt/XlibWrapper.c
+32
-0
未找到文件。
make/sun/xawt/mapfile-vers
浏览文件 @
cae87d11
...
...
@@ -125,6 +125,7 @@ SUNWprivate_1.1 {
Java_sun_awt_X11_XlibWrapper_XFree;
Java_sun_awt_X11_XlibWrapper_ServerVendor;
Java_sun_awt_X11_XlibWrapper_VendorRelease;
Java_sun_awt_X11_XlibWrapper_IsXsunKPBehavior;
Java_sun_awt_X11_XlibWrapper_SetToolkitErrorHandler;
Java_sun_awt_X11_XlibWrapper_XSetErrorHandler;
Java_sun_awt_X11_XlibWrapper_CallErrorHandler;
...
...
src/solaris/classes/sun/awt/X11/XKeysym.java
浏览文件 @
cae87d11
...
...
@@ -145,7 +145,7 @@ public class XKeysym {
{
// Xsun without XKB uses keysymarray[2] keysym to determine if it is KP event.
// Otherwise, it is [1].
int
ndx
=
XToolkit
.
isXsun
Serve
r
()
&&
int
ndx
=
XToolkit
.
isXsun
KPBehavio
r
()
&&
!
XToolkit
.
isXKBenabled
()
?
2
:
1
;
// Even if XKB is enabled, we have another problem: some symbol tables (e.g. cz) force
// a regular comma instead of KP_comma for a decimal separator. Result is,
...
...
@@ -193,7 +193,7 @@ public class XKeysym {
private
static
long
getKeypadKeysym
(
XKeyEvent
ev
)
{
int
ndx
=
0
;
long
keysym
=
XConstants
.
NoSymbol
;
if
(
XToolkit
.
isXsun
Serve
r
()
&&
if
(
XToolkit
.
isXsun
KPBehavio
r
()
&&
!
XToolkit
.
isXKBenabled
()
)
{
if
(
(
ev
.
get_state
()
&
XConstants
.
ShiftMask
)
!=
0
)
{
// shift modifier is on
ndx
=
3
;
...
...
src/solaris/classes/sun/awt/X11/XToolkit.java
浏览文件 @
cae87d11
...
...
@@ -2130,39 +2130,33 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
*/
private
static
int
backingStoreType
;
static
boolean
awt_ServerInquired
=
false
;
static
boolean
awt_IsXsunServer
=
false
;
static
final
int
XSUN_KP_BEHAVIOR
=
1
;
static
final
int
XORG_KP_BEHAVIOR
=
2
;
static
int
awt_IsXsunKPBehavior
=
0
;
static
boolean
awt_UseXKB
=
false
;
static
boolean
awt_UseXKB_Calls
=
false
;
static
int
awt_XKBBaseEventCode
=
0
;
static
int
awt_XKBEffectiveGroup
=
0
;
// so far, I don't use it leaving all calculations
// to XkbTranslateKeyCode
static
long
awt_XKBDescPtr
=
0
;
/**
Try to understand if it is Xsun server.
By now (2005) Sun is vendor of Xsun and Xorg servers; we only return true if Xsun is running.
*/
static
boolean
isXsunServer
()
{
* Check for Xsun convention regarding numpad keys.
* Xsun and some other servers (i.e. derived from Xsun)
* under certain conditions process numpad keys unlike Xorg.
*/
static
boolean
isXsunKPBehavior
()
{
awtLock
();
try
{
if
(
awt_ServerInquired
)
{
return
awt_IsXsunServer
;
}
if
(
!
XlibWrapper
.
ServerVendor
(
getDisplay
()).
startsWith
(
"Sun Microsystems"
)
)
{
awt_ServerInquired
=
true
;
awt_IsXsunServer
=
false
;
return
false
;
}
// Now, it's Sun. It still may be Xorg though, eg on Solaris 10, x86.
// Today (2005), VendorRelease of Xorg is a Big Number unlike Xsun.
if
(
XlibWrapper
.
VendorRelease
(
getDisplay
())
>
10000
)
{
awt_ServerInquired
=
true
;
awt_IsXsunServer
=
false
;
return
false
;
if
(
awt_IsXsunKPBehavior
==
0
)
{
if
(
XlibWrapper
.
IsXsunKPBehavior
(
getDisplay
())
)
{
awt_IsXsunKPBehavior
=
XSUN_KP_BEHAVIOR
;
}
else
{
awt_IsXsunKPBehavior
=
XORG_KP_BEHAVIOR
;
}
}
awt_ServerInquired
=
true
;
awt_IsXsunServer
=
true
;
return
true
;
return
awt_IsXsunKPBehavior
==
XSUN_KP_BEHAVIOR
?
true
:
false
;
}
finally
{
awtUnlock
();
}
...
...
src/solaris/classes/sun/awt/X11/XlibWrapper.java
浏览文件 @
cae87d11
...
...
@@ -352,6 +352,7 @@ static native String XSetLocaleModifiers(String modifier_list);
static
native
int
XIconifyWindow
(
long
display
,
long
window
,
long
screenNumber
);
static
native
String
ServerVendor
(
long
display
);
static
native
int
VendorRelease
(
long
display
);
static
native
boolean
IsXsunKPBehavior
(
long
display
);
static
native
void
XBell
(
long
display
,
int
percent
);
...
...
src/solaris/classes/sun/awt/X11/keysym2ucs.h
浏览文件 @
cae87d11
...
...
@@ -183,7 +183,7 @@ tojava public static boolean isKPEvent( XKeyEvent ev )
tojava
{
tojava
// Xsun without XKB uses keysymarray[2] keysym to determine if it is KP event.
tojava
// Otherwise, it is [1].
tojava
int
ndx
=
XToolkit
.
isXsun
Serve
r
()
&&
tojava
int
ndx
=
XToolkit
.
isXsun
KPBehavio
r
()
&&
tojava
!
XToolkit
.
isXKBenabled
()
?
2
:
1
;
tojava
// Even if XKB is enabled, we have another problem: some symbol tables (e.g. cz) force
tojava
// a regular comma instead of KP_comma for a decimal separator. Result is,
...
...
@@ -231,7 +231,7 @@ tojava */
tojava
private
static
long
getKeypadKeysym
(
XKeyEvent
ev
)
{
tojava
int
ndx
=
0
;
tojava
long
keysym
=
XConstants
.
NoSymbol
;
tojava
if
(
XToolkit
.
isXsun
Serve
r
()
&&
tojava
if
(
XToolkit
.
isXsun
KPBehavio
r
()
&&
tojava
!
XToolkit
.
isXKBenabled
()
)
{
tojava
if
(
(
ev
.
get_state
()
&
XConstants
.
ShiftMask
)
!=
0
)
{
// shift modifier is on
tojava
ndx
=
3
;
...
...
src/solaris/native/sun/xawt/XlibWrapper.c
浏览文件 @
cae87d11
...
...
@@ -1181,6 +1181,38 @@ JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_VendorRelease
AWT_CHECK_HAVE_LOCK
();
return
VendorRelease
((
Display
*
)
jlong_to_ptr
(
display
));
}
/*
* Class: sun_awt_X11_XlibWrapper
* Method: IsXsunKPBehavior
* Signature: (J)Z;
*/
JNIEXPORT
jboolean
JNICALL
Java_sun_awt_X11_XlibWrapper_IsXsunKPBehavior
(
JNIEnv
*
env
,
jclass
clazz
,
jlong
display
)
{
// Xsun without XKB uses keysymarray[2] keysym to determine if it is KP event.
// Otherwise, it is [1] or sometimes [0].
// This sniffer first tries to determine what is a keycode for XK_KP_7
// using XKeysymToKeycode;
// second, in which place in the keysymarray is XK_KP_7
// using XKeycodeToKeysym.
int
kc7
;
AWT_CHECK_HAVE_LOCK
();
kc7
=
XKeysymToKeycode
((
Display
*
)
jlong_to_ptr
(
display
),
XK_KP_7
);
if
(
!
kc7
)
{
// keycode is not defined. Why, it's a reduced keyboard perhaps:
// report arbitrarily false.
return
JNI_FALSE
;
}
else
{
long
ks2
=
XKeycodeToKeysym
((
Display
*
)
jlong_to_ptr
(
display
),
kc7
,
2
);
if
(
ks2
==
XK_KP_7
)
{
//XXX If some Xorg server would put XK_KP_7 in keysymarray[2] as well,
//XXX for yet unknown to me reason, the sniffer would lie.
return
JNI_TRUE
;
}
else
{
return
JNI_FALSE
;
}
}
}
JavaVM
*
jvm
=
NULL
;
static
int
ToolkitErrorHandler
(
Display
*
dpy
,
XErrorEvent
*
event
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录