EVALUATION
Since this is an escalation, I will assume that a sustaining engineer
will be working on it. I will assign it to an AWT engineer for tracking
purposes.
###@###.### 2003-08-15
Usually a focus gain on setVisible of EmbeddedFrame is simulated but these applets both become visible at once and therefore only one of them actually gets the required focus events. When we click on the second "unlucky" applet the focus gain is not happening.
Solution is to catch all mouse events in awt_MToolkit.c:processOneEvent, then, find to which toplevel they go.
Then, we should check if it is focused. If it is not focused - and it is
ButtonPress we need to call synthesizeFocusIn to generate
necessary focus events.
###@###.### 2003-09-14
We believe this problem has been resolved by the XEmbed work done in 1.5.
###@###.### 2003-10-28
|
SUGGESTED FIX
src/solaris/native/sun/awt/awt_TopLevel.h
7c7
< * @(#)awt_TopLevel.h 1.6 03/01/23
---
> * %W% %E%
16a17
> extern void callSynthesize(JNIEnv *env,jobject peer);
src/solaris/native/sun/awt/awt_TopLevel.c
2c2
< * @(#)awt_TopLevel.c 1.102 03/08/25
---
> * %W% %E%
2076a2077,2100
> extern void callSynthesize(JNIEnv *env,jobject peer)
> {
> EmbeddedFrame *ef;
> Boolean dummy;
> AWT_LOCK();
> ef = theEmbeddedFrameList;
> while (ef != NULL) {
> if ((*env)->IsSameObject(env, ef->javaRef, peer)) {
> XFocusChangeEvent xev;
> xev.display = awt_display;
> xev.serial = 0;
> xev.type = FocusIn;
> xev.send_event = False;
> xev.window = XtWindow(ef->embeddedFrame);
> xev.mode = NotifyNormal;
> xev.detail = NotifyNonlinear;
> shellEH(ef->embeddedFrame, peer, (XEvent*)&xev, &dummy);
> break;
> }
> ef = ef->next;
> }
> AWT_UNLOCK();
> }
>
4132,4152c4156
< EmbeddedFrame *ef;
< Boolean dummy;
<
< AWT_LOCK();
< ef = theEmbeddedFrameList;
< while (ef != NULL) {
< if ((*env)->IsSameObject(env, ef->javaRef, this)) {
< XFocusChangeEvent xev;
< xev.display = awt_display;
< xev.serial = 0;
< xev.type = FocusIn;
< xev.send_event = False;
< xev.window = XtWindow(ef->embeddedFrame);
< xev.mode = NotifyNormal;
< xev.detail = NotifyNonlinear;
< shellEH(ef->embeddedFrame, this, (XEvent*)&xev, &dummy);
< break;
< }
< ef = ef->next;
< }
< AWT_UNLOCK();
---
> callSynthesize(env,this);
src/solaris/native/sun/awt/awt_MToolkit.c
2c2
< * @(#)awt_MToolkit.c 1.206 03/01/23
---
> * %W% %E%
1505a1506,1522
> void *peer;
> jobject target;
> jobject targetPeer;
> jobject l_peer;
> JNIEnv *env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2);
> peer = findPeer(&widget);
> if (peer == NULL) return;
> target = findTopLevel(peer, env);
> if (target == NULL) return;
> AWT_LOCK();
> l_peer = awt_canvas_getFocusedWindowPeer();
> AWT_UNLOCK();
> if (l_peer == NULL) return;
> targetPeer = (*env)->GetObjectField(env,target, componentIDs.peer);
> if (!(*env)->IsSameObject(env,targetPeer,l_peer))
> callSynthesize(env,targetPeer);
###@###.### 2003-09-14
|