Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
da85f117
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看板
提交
da85f117
编写于
3月 21, 2012
作者:
D
dcherepanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7150345: [macosx] Can't type into applets
Reviewed-by: ant
上级
34e71365
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
70 addition
and
11 deletion
+70
-11
src/macosx/classes/sun/lwawt/LWToolkit.java
src/macosx/classes/sun/lwawt/LWToolkit.java
+0
-5
src/macosx/classes/sun/lwawt/LWWindowPeer.java
src/macosx/classes/sun/lwawt/LWWindowPeer.java
+1
-5
src/macosx/classes/sun/lwawt/PlatformWindow.java
src/macosx/classes/sun/lwawt/PlatformWindow.java
+3
-0
src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java
src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java
+29
-0
src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
...cosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
+19
-0
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+14
-0
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
+4
-1
未找到文件。
src/macosx/classes/sun/lwawt/LWToolkit.java
浏览文件 @
da85f117
...
...
@@ -522,11 +522,6 @@ public abstract class LWToolkit extends SunToolkit implements Runnable {
postEvent
(
targetToAppContext
(
event
.
getSource
()),
event
);
}
/*
* Returns true if the application (one of its windows) owns keyboard focus.
*/
public
abstract
boolean
isApplicationActive
();
// use peer's back buffer to implement non-opaque windows.
@Override
public
boolean
needUpdateWindow
()
{
...
...
src/macosx/classes/sun/lwawt/LWWindowPeer.java
浏览文件 @
da85f117
...
...
@@ -1067,11 +1067,7 @@ public class LWWindowPeer
return
false
;
}
// Cross-app activation requests are not allowed.
if
(
cause
!=
CausedFocusEvent
.
Cause
.
MOUSE_EVENT
&&
!((
LWToolkit
)
Toolkit
.
getDefaultToolkit
()).
isApplicationActive
())
{
focusLog
.
fine
(
"the app is inactive, so the request is rejected"
);
if
(
platformWindow
.
rejectFocusRequest
(
cause
))
{
return
false
;
}
...
...
src/macosx/classes/sun/lwawt/PlatformWindow.java
浏览文件 @
da85f117
...
...
@@ -27,6 +27,7 @@ package sun.lwawt;
import
java.awt.*
;
import
sun.awt.CausedFocusEvent
;
import
sun.java2d.SurfaceData
;
// TODO Is it worth to generify this interface, like that:
...
...
@@ -117,6 +118,8 @@ public interface PlatformWindow {
public
void
updateFocusableWindowState
();
public
boolean
rejectFocusRequest
(
CausedFocusEvent
.
Cause
cause
);
public
boolean
requestWindowFocus
();
/*
...
...
src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java
浏览文件 @
da85f117
...
...
@@ -38,6 +38,8 @@ import java.awt.event.*;
public
class
CEmbeddedFrame
extends
EmbeddedFrame
{
private
CPlatformResponder
responder
;
private
boolean
focused
=
true
;
private
boolean
parentWindowActive
=
true
;
public
CEmbeddedFrame
()
{
show
();
...
...
@@ -94,4 +96,31 @@ public class CEmbeddedFrame extends EmbeddedFrame {
public
void
handleInputEvent
(
String
text
)
{
new
RuntimeException
(
"Not implemented"
);
}
public
void
handleFocusEvent
(
boolean
focused
)
{
this
.
focused
=
focused
;
updateOverlayWindowActiveState
();
}
public
void
handleWindowFocusEvent
(
boolean
parentWindowActive
)
{
this
.
parentWindowActive
=
parentWindowActive
;
updateOverlayWindowActiveState
();
}
public
boolean
isParentWindowActive
()
{
return
parentWindowActive
;
}
/*
* May change appearance of contents of window, and generate a
* WINDOW_ACTIVATED event.
*/
private
void
updateOverlayWindowActiveState
()
{
final
boolean
showAsFocused
=
parentWindowActive
&&
focused
;
dispatchEvent
(
new
FocusEvent
(
this
,
showAsFocused
?
FocusEvent
.
FOCUS_GAINED
:
FocusEvent
.
FOCUS_LOST
));
}
}
src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java
浏览文件 @
da85f117
...
...
@@ -33,17 +33,23 @@ import sun.java2d.SurfaceData;
import
sun.awt.CGraphicsConfig
;
import
sun.awt.CGraphicsDevice
;
import
sun.awt.CausedFocusEvent
;
import
java.awt.*
;
import
java.awt.BufferCapabilities.FlipContents
;
import
sun.util.logging.PlatformLogger
;
/*
* Provides a lightweight implementation of the EmbeddedFrame.
*/
public
class
CPlatformEmbeddedFrame
implements
PlatformWindow
{
private
static
final
PlatformLogger
focusLogger
=
PlatformLogger
.
getLogger
(
"sun.lwawt.macosx.focus.CPlatformEmbeddedFrame"
);
private
CGLLayer
windowLayer
;
private
LWWindowPeer
peer
;
private
CEmbeddedFrame
target
;
private
volatile
int
screenX
=
0
;
private
volatile
int
screenY
=
0
;
...
...
@@ -52,6 +58,7 @@ public class CPlatformEmbeddedFrame implements PlatformWindow {
public
void
initialize
(
Window
target
,
final
LWWindowPeer
peer
,
PlatformWindow
owner
)
{
this
.
peer
=
peer
;
this
.
windowLayer
=
new
CGLLayer
(
peer
);
this
.
target
=
(
CEmbeddedFrame
)
target
;
}
@Override
...
...
@@ -148,6 +155,18 @@ public class CPlatformEmbeddedFrame implements PlatformWindow {
@Override
public
void
updateFocusableWindowState
()
{}
@Override
public
boolean
rejectFocusRequest
(
CausedFocusEvent
.
Cause
cause
)
{
// Cross-app activation requests are not allowed.
if
(
cause
!=
CausedFocusEvent
.
Cause
.
MOUSE_EVENT
&&
!
target
.
isParentWindowActive
())
{
focusLogger
.
fine
(
"the embedder is inactive, so the request is rejected"
);
return
true
;
}
return
false
;
}
@Override
public
boolean
requestWindowFocus
()
{
return
true
;
...
...
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
浏览文件 @
da85f117
...
...
@@ -65,6 +65,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
// Loger to report issues happened during execution but that do not affect functionality
private
static
final
PlatformLogger
logger
=
PlatformLogger
.
getLogger
(
"sun.lwawt.macosx.CPlatformWindow"
);
private
static
final
PlatformLogger
focusLogger
=
PlatformLogger
.
getLogger
(
"sun.lwawt.macosx.focus.CPlatformWindow"
);
// for client properties
public
static
final
String
WINDOW_BRUSH_METAL_LOOK
=
"apple.awt.brushMetalLook"
;
...
...
@@ -599,8 +600,21 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
nativeSetNSWindowMinMax
(
nsWindowPtr
,
min
.
getWidth
(),
min
.
getHeight
(),
max
.
getWidth
(),
max
.
getHeight
());
}
@Override
public
boolean
rejectFocusRequest
(
CausedFocusEvent
.
Cause
cause
)
{
// Cross-app activation requests are not allowed.
if
(
cause
!=
CausedFocusEvent
.
Cause
.
MOUSE_EVENT
&&
!((
LWCToolkit
)
Toolkit
.
getDefaultToolkit
()).
isApplicationActive
())
{
focusLogger
.
fine
(
"the app is inactive, so the request is rejected"
);
return
true
;
}
return
false
;
}
@Override
public
boolean
requestWindowFocus
()
{
long
ptr
=
getNSWindowPtr
();
if
(
CWrapper
.
NSWindow
.
canBecomeMainWindow
(
ptr
))
{
CWrapper
.
NSWindow
.
makeMainWindow
(
ptr
);
...
...
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
浏览文件 @
da85f117
...
...
@@ -686,7 +686,10 @@ public class LWCToolkit extends LWToolkit {
return
sunAwtDisableCALayers
.
booleanValue
();
}
@Override
/*
* Returns true if the application (one of its windows) owns keyboard focus.
*/
public
native
boolean
isApplicationActive
();
/************************
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录