EVALUATION
There is a dependency between this, 6537010, 6453597, 6521732. A fix for this is required before seeing 6537010.
|
|
|
EVALUATION
After debugging AWT XEmbed code I found the following. When I click S with mouse, it generates XEMBED_REQUEST_FOCUS message and sends it to C. According to the specification, C should request focus and then reply with XEMBED_FOCUS_IN, but this doesn't happen.
Thus, the problem is that C can't request focus from embedding applet. I was able to find out why. When C receives XEMBED_REQUEST_FOCUS it checks if its top-level is an active window and calls requestFocusInWindow. The problem is that the top-level (applet's XEmbeddedFrame) has no focus and is not an active window, so requestFocusInWindow is not called. And even if I remove the check for active window, this would not be enough: requestFocusInWindow must be replaced with requestFocus. This is what the fix for this bug is.
|
|
|
SUGGESTED FIX
--- XEmbedCanvasPeer.java 2007-02-14 17:59:59.000000000 +0300
***************
*** 335,341 ****
xembedLog.fine("Requesting focus for client");
postEvent(new InvocationEvent(target, new Runnable() {
public void run() {
! target.requestFocusInWindow();
}
}));
} else {
--- 335,341 ----
xembedLog.fine("Requesting focus for client");
postEvent(new InvocationEvent(target, new Runnable() {
public void run() {
! target.requestFocus();
}
}));
} else {
--- XEmbeddedFramePeer.java 2007-02-14 18:05:42.000000000 +0300
***************
*** 76,89 ****
public boolean requestWindowFocus() {
// Should check for active state of host application
if (embedder != null && embedder.isActive()) {
! if (embedder.isApplicationActive()) {
! xembedLog.fine("Requesting focus from embedding host");
! embedder.requestFocus();
! return true;
! } else {
! xembedLog.fine("Host application is not active");
! return false;
! }
} else {
xembedLog.fine("Requesting focus from X");
return super.requestWindowFocus();
--- 76,84 ----
public boolean requestWindowFocus() {
// Should check for active state of host application
if (embedder != null && embedder.isActive()) {
! xembedLog.fine("Requesting focus from embedding host");
! embedder.requestFocus();
! return true;
} else {
xembedLog.fine("Requesting focus from X");
return super.requestWindowFocus();
|
|
|
SUGGESTED FIX
The full version of the fix can be found at the following location:
http://sa.sfbay.sun.com/projects/awt_data/7/6524986
|
|
|
|