Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
56a9678e
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看板
提交
56a9678e
编写于
11月 26, 2010
作者:
D
dcherepanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6699851: setMaximizedbounds not working properly on dual screen environment
Reviewed-by: art, anthony
上级
a079c818
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
4 deletion
+57
-4
src/share/classes/java/awt/Frame.java
src/share/classes/java/awt/Frame.java
+12
-3
src/share/classes/sun/awt/AWTAccessor.java
src/share/classes/sun/awt/AWTAccessor.java
+4
-0
src/windows/classes/sun/awt/windows/WFramePeer.java
src/windows/classes/sun/awt/windows/WFramePeer.java
+41
-1
未找到文件。
src/share/classes/java/awt/Frame.java
浏览文件 @
56a9678e
...
...
@@ -828,6 +828,11 @@ public class Frame extends Window implements MenuContainer {
return
frame
.
state
;
}
}
public
Rectangle
getMaximizedBounds
(
Frame
frame
)
{
synchronized
(
frame
.
getObjectLock
())
{
return
frame
.
maximizedBounds
;
}
}
}
);
}
...
...
@@ -855,8 +860,10 @@ public class Frame extends Window implements MenuContainer {
* @see #getMaximizedBounds()
* @since 1.4
*/
public
synchronized
void
setMaximizedBounds
(
Rectangle
bounds
)
{
this
.
maximizedBounds
=
bounds
;
public
void
setMaximizedBounds
(
Rectangle
bounds
)
{
synchronized
(
getObjectLock
())
{
this
.
maximizedBounds
=
bounds
;
}
FramePeer
peer
=
(
FramePeer
)
this
.
peer
;
if
(
peer
!=
null
)
{
peer
.
setMaximizedBounds
(
bounds
);
...
...
@@ -873,7 +880,9 @@ public class Frame extends Window implements MenuContainer {
* @since 1.4
*/
public
Rectangle
getMaximizedBounds
()
{
return
maximizedBounds
;
synchronized
(
getObjectLock
())
{
return
maximizedBounds
;
}
}
...
...
src/share/classes/sun/awt/AWTAccessor.java
浏览文件 @
56a9678e
...
...
@@ -334,6 +334,10 @@ public final class AWTAccessor {
* Gets the state of this frame.
*/
int
getExtendedState
(
Frame
frame
);
/*
* Gets the maximized bounds of this frame.
*/
Rectangle
getMaximizedBounds
(
Frame
frame
);
}
/*
...
...
src/windows/classes/sun/awt/windows/WFramePeer.java
浏览文件 @
56a9678e
...
...
@@ -79,10 +79,50 @@ class WFramePeer extends WWindowPeer implements FramePeer {
if
(
b
==
null
)
{
clearMaximizedBounds
();
}
else
{
setMaximizedBounds
(
b
.
x
,
b
.
y
,
b
.
width
,
b
.
height
);
Rectangle
adjBounds
=
(
Rectangle
)
b
.
clone
();
adjustMaximizedBounds
(
adjBounds
);
setMaximizedBounds
(
adjBounds
.
x
,
adjBounds
.
y
,
adjBounds
.
width
,
adjBounds
.
height
);
}
}
/**
* The incoming bounds describe the maximized size and position of the
* window on the monitor that displays the window. But the window manager
* expects that the bounds are based on the size and position of the
* primary monitor, even if the window ultimately maximizes onto a
* secondary monitor. And the window manager adjusts these values to
* compensate for differences between the primary monitor and the monitor
* that displays the window.
* The method translates the incoming bounds to the values acceptable
* by the window manager. For more details, please refer to 6699851.
*/
private
void
adjustMaximizedBounds
(
Rectangle
b
)
{
GraphicsConfiguration
currentDevGC
=
getGraphicsConfiguration
();
GraphicsDevice
primaryDev
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
().
getDefaultScreenDevice
();
GraphicsConfiguration
primaryDevGC
=
primaryDev
.
getDefaultConfiguration
();
if
(
currentDevGC
!=
null
&&
currentDevGC
!=
primaryDevGC
)
{
Rectangle
currentDevBounds
=
currentDevGC
.
getBounds
();
Rectangle
primaryDevBounds
=
primaryDevGC
.
getBounds
();
b
.
width
-=
(
currentDevBounds
.
width
-
primaryDevBounds
.
width
);
b
.
height
-=
(
currentDevBounds
.
height
-
primaryDevBounds
.
height
);
}
}
@Override
public
boolean
updateGraphicsData
(
GraphicsConfiguration
gc
)
{
boolean
result
=
super
.
updateGraphicsData
(
gc
);
Rectangle
bounds
=
AWTAccessor
.
getFrameAccessor
().
getMaximizedBounds
((
Frame
)
target
);
if
(
bounds
!=
null
)
{
setMaximizedBounds
(
bounds
);
}
return
result
;
}
@Override
boolean
isTargetUndecorated
()
{
return
((
Frame
)
target
).
isUndecorated
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录