[PATCH] 7160951: ActionListener called twice for JMenuItem using ScreenMenuBar

Leonid Romanov leonid.romanov at oracle.com
Wed Sep 5 13:47:25 PDT 2012


Ah, I completely forgot about this possibility, thanks! ) I've done some testing and it seems like check box menu item suffers from the same problem, the only difference is that it is ItemListener that gets called twice. Overall, however, your fix is good. 
Since this bug is on me, I'll prepare a formal review and push it into 7u10/8, with you as a contributor.

Leonid.

On Sep 5, 2012, at 10:56 PM, Marco Dinacci <marco.dinacci at gmail.com> wrote:

> Hi Leonid,
> 
>> Why do we need  [menuKey isEqualToString:eventKey] check? If Cocoa has called our action callback and the type of the event which triggered that call is NSKeyDown, doesn't it mean we can be sure that a shortcut has been pressed?
> 
> no because there's the case when a user select a menu item pressing
> space or enter.
> In this case the event is of type NSKeyDown but the keyEquivalent is
> empty. If this happens the event has to be propagated.
> 
> Best,
> Marco



More information about the macosx-port-dev mailing list