Request for review 7156191 [macosx] Can't type into applet demos in Pivot

Anton V. Tarasov anton.tarasov at
Wed Mar 28 03:09:48 PDT 2012

Hi Dmitry,

On 28.03.2012 11:48, Dmitry Cherepanov wrote:
> Hi Anton,
> Anton V. Tarasov wrote:
>> Hi Dmitry,
>> Let me share my thoughts on it.
> Thanks for your feedback!
>> Another question is whether handleFocusEvent(false) is called in response  to deactivating the 
>> browser window by, say, alt-tab? I would expect the methods are called in the following order:
>> handleFocusEvent(false)
>> handleWindowFocusEvent(false)
> Not exactly. The plugin receives the FocusChanged event when it gains/loses focus but it doesn't 
> receive the event when the top-level window becomes the active (or inactive) window (by pressing 
> alt-tab or mouse click). That is, if the user deactivates the browser and then activates it back 
> by pressing alt-tab twice, we receive the following events:
> WindowFocusChanged(false)
> WindowFocusChanged(true)
> That means we still need to activate/deactivate the embedded frame upon receiving the 
> WindowFocusChanged event if the plugin gained focus before.

Oh, that is surprising... Ok, let it be so then.

> Indeed, we shouldn't activate/deactivate the embedded frame when the plugin doesn't have focus. 
> I've updated the implementation of the updateOverlayWindowActiveState method:
>        if (focused) {
>            responder.handleWindowFocusEvent(parentWindowActive);
>        }
> Does it make sense? I've verified that the modified change fixes the bug and I haven't found any 
> regression.

This works for handleWindowFocusEvent(boolean parentWindowActive), but what about switching focus 
somewhere inside the browser but outside the plugin?

  100     public void handleFocusEvent(boolean focused) {
  101         this.focused = focused;
  102         updateOverlayWindowActiveState();
  103     }

This will call updateOverlayWindowActiveState() where focused==false and so the EmbeddedFrame won't 
be notified about deactivation.

Also, is it possible to have handleFocusEvent(true) called when the browser is inactive? If so, the 
EmbeddedFrame will receive unrelated notification.

Did I get it right?


> Thanks again,
> Dmitry

More information about the macosx-port-dev mailing list