Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
18df8567
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看板
提交
18df8567
编写于
10月 08, 2008
作者:
D
dav
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
5076635: Double click speed is not honored in KDE linux
Reviewed-by: art, dcherepanov
上级
042de0b4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
162 addition
and
6 deletion
+162
-6
src/solaris/classes/sun/awt/X11/XToolkit.java
src/solaris/classes/sun/awt/X11/XToolkit.java
+8
-6
test/java/awt/Mouse/MaximizedFrameTest/MaximizedFrameTest.html
...java/awt/Mouse/MaximizedFrameTest/MaximizedFrameTest.html
+42
-0
test/java/awt/Mouse/MaximizedFrameTest/MaximizedFrameTest.java
...java/awt/Mouse/MaximizedFrameTest/MaximizedFrameTest.java
+112
-0
未找到文件。
src/solaris/classes/sun/awt/X11/XToolkit.java
浏览文件 @
18df8567
...
...
@@ -61,6 +61,10 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
private
static
Logger
keyEventLog
=
Logger
.
getLogger
(
"sun.awt.X11.kye.XToolkit"
);
private
static
final
Logger
backingStoreLog
=
Logger
.
getLogger
(
"sun.awt.X11.backingStore.XToolkit"
);
//There is 400 ms is set by default on Windows and 500 by default on KDE and GNOME.
//We use the same hardcoded constant.
private
final
static
int
AWT_MULTICLICK_DEFAULT_TIME
=
500
;
static
final
boolean
PRIMARY_LOOP
=
false
;
static
final
boolean
SECONDARY_LOOP
=
true
;
...
...
@@ -1211,7 +1215,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
String
multiclick_time_query
=
XlibWrapper
.
XGetDefault
(
XToolkit
.
getDisplay
(),
"*"
,
"multiClickTime"
);
if
(
multiclick_time_query
!=
null
)
{
awt_multiclick_time
=
(
int
)
Long
.
parseLong
(
multiclick_time_query
);
// awt_multiclick_time = XtGetMultiClickTime(awt_display);
}
else
{
multiclick_time_query
=
XlibWrapper
.
XGetDefault
(
XToolkit
.
getDisplay
(),
"OpenWindows"
,
"MultiClickTimeout"
);
...
...
@@ -1221,20 +1224,19 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
milliseconds */
awt_multiclick_time
=
(
int
)
Long
.
parseLong
(
multiclick_time_query
)
*
100
;
}
else
{
awt_multiclick_time
=
200
;
// awt_multiclick_time = XtGetMultiClickTime(awt_display);
awt_multiclick_time
=
AWT_MULTICLICK_DEFAULT_TIME
;
}
}
}
catch
(
NumberFormatException
nf
)
{
awt_multiclick_time
=
200
;
awt_multiclick_time
=
AWT_MULTICLICK_DEFAULT_TIME
;
}
catch
(
NullPointerException
npe
)
{
awt_multiclick_time
=
200
;
awt_multiclick_time
=
AWT_MULTICLICK_DEFAULT_TIME
;
}
}
finally
{
awtUnlock
();
}
if
(
awt_multiclick_time
==
0
)
{
awt_multiclick_time
=
200
;
awt_multiclick_time
=
AWT_MULTICLICK_DEFAULT_TIME
;
}
}
...
...
test/java/awt/Mouse/MaximizedFrameTest/MaximizedFrameTest.html
0 → 100644
浏览文件 @
18df8567
/*
* Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
<!--
@test
@bug 6176814
@summary Metalworks frame maximizes after the move
@author Andrei.Dmitriev.Com area=Event
@run applet MaximizedFrameTest.html
-->
<head>
<title>
</title>
</head>
<body>
<h1>
bug 6176814
<br>
Bug ID: 6176814
</h1>
<p>
This is an AUTOMATIC test, simply wait for completion
</p>
<APPLET
CODE=
"MaximizedFrameTest.class"
WIDTH=
200
HEIGHT=
200
></APPLET>
</body>
</html>
test/java/awt/Mouse/MaximizedFrameTest/MaximizedFrameTest.java
0 → 100644
浏览文件 @
18df8567
/*
* Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
test
@bug 6176814
@summary Metalworks frame maximizes after the move
@author Andrei.Dmitriev area=Event
@run applet MaximizedFrameTest.html
*/
import
java.applet.Applet
;
import
javax.swing.*
;
import
java.awt.event.*
;
import
java.awt.*
;
public
class
MaximizedFrameTest
extends
Applet
{
final
int
ITERATIONS_COUNT
=
20
;
Robot
robot
;
Point
framePosition
;
Point
newFrameLocation
;
JFrame
frame
;
Rectangle
gcBounds
;
public
static
Object
LOCK
=
new
Object
();
public
void
init
()
{
String
[]
instructions
=
{
"This is an AUTOMATIC test"
,
"simply wait until it is done"
};
JFrame
.
setDefaultLookAndFeelDecorated
(
true
);
frame
=
new
JFrame
(
"JFrame Maximization Test"
);
frame
.
pack
();
frame
.
setSize
(
450
,
260
);
}
//End init()
public
void
start
()
{
frame
.
setVisible
(
true
);
validate
();
JLayeredPane
lPane
=
frame
.
getLayeredPane
();
// System.out.println("JFrame's LayeredPane " + lPane );
Component
titleComponent
=
null
;
boolean
titleFound
=
false
;
for
(
int
j
=
0
;
j
<
lPane
.
getComponentsInLayer
(
JLayeredPane
.
FRAME_CONTENT_LAYER
.
intValue
()).
length
;
j
++){
titleComponent
=
lPane
.
getComponentsInLayer
(
JLayeredPane
.
FRAME_CONTENT_LAYER
.
intValue
())[
j
];
if
(
titleComponent
.
getClass
().
getName
().
equals
(
"javax.swing.plaf.metal.MetalTitlePane"
)){
titleFound
=
true
;
break
;
}
}
if
(
!
titleFound
){
throw
new
RuntimeException
(
"Test Failed. Unable to determine title's size."
);
}
//--------------------------------
// it is sufficient to get maximized Frame only once.
Point
tempMousePosition
;
framePosition
=
frame
.
getLocationOnScreen
();
try
{
robot
=
new
Robot
();
tempMousePosition
=
new
Point
(
framePosition
.
x
+
frame
.
getWidth
()/
2
,
framePosition
.
y
+
titleComponent
.
getHeight
()/
2
);
robot
.
mouseMove
(
tempMousePosition
.
x
,
tempMousePosition
.
y
);
for
(
int
iteration
=
0
;
iteration
<
ITERATIONS_COUNT
;
iteration
++){
robot
.
mousePress
(
InputEvent
.
BUTTON1_MASK
);
gcBounds
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
().
getScreenDevices
()[
0
].
getConfigurations
()[
0
].
getBounds
();
//Moving a mouse pointer less than a few pixels
//leads to rising a double click event.
//We have to use exceeded the AWT_MULTICLICK_SMUDGE
//const value (which is 4 by default on GNOME) to test that.
tempMousePosition
.
x
+=
5
;
robot
.
mouseMove
(
tempMousePosition
.
x
,
tempMousePosition
.
y
);
robot
.
delay
(
70
);
robot
.
mouseRelease
(
InputEvent
.
BUTTON1_MASK
);
if
(
frame
.
getExtendedState
()
!=
0
){
throw
new
RuntimeException
(
"Test failed. JFrame was maximized. ExtendedState is : "
+
frame
.
getExtendedState
());
}
robot
.
delay
(
500
);
}
//for iteration
}
catch
(
AWTException
e
)
{
throw
new
RuntimeException
(
"Test Failed. AWTException thrown."
);
}
System
.
out
.
println
(
"Test passed."
);
}
// start()
}
// class
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录