<AWT Dev>  JDK-8146537: TrayIcon Action Listener doesnt work in WIndows 10
semyon.sadetsky at oracle.com
Wed Dec 6 18:42:12 UTC 2017
On 12/05/2017 08:13 PM, Shashidhara Veerabhadraiah wrote:
> Hi Semyon, the mouse key state is already part of the input to the function via the flags variable(if there is any) and same message is already sent to the action event where
The flags parameter doesn't contain any modifiers because it is always
equals to zero.
> they only save the message. This part is kept same as earlier.
The action event receives modifiers from the 3rd parameter of the
SendMouseEvent function which now may not contain any mouse modifiers,
if I correctly understand the root cause of the issue. My question is
about compatibility. If this code whenever have been working (for
example, in Windows 7) the BUTTON1_DOWN_MASK have been always set in the
action event. After your fix it may not be set (or even will never be
set anymore). Does it affect old applications which might expect a
button presence in the action?
> -----Original Message-----
> From: Semyon Sadetsky
> Sent: Tuesday, December 5, 2017 9:47 PM
> To: shashidhara veerabhadraiah <shashidhara.veerabhadraiah at oracle.com>
> Cc: awt-dev at openjdk.java.net
> Subject: Re: <AWT Dev>  JDK-8146537: TrayIcon Action Listener doesnt work in WIndows 10
> Hi Shashi,
> I meant, since before the modifier has been sent with the action it should be sent now as well for compatibility. Or this code has never worked?
> On 12/04/2017 09:30 AM, shashidhara veerabhadraiah wrote:
>> Hi Semyon, Thank for your review.
>> BUTTON1_DOWN_MASK upon the GetJavaModifiers() provide if the left mouse button virtual key is pressed or not. Currently we are unable to capture left button click state using the ::GetKeyState(). The event NIN_BALLONUSERCLICK is generated only upon the left mouse click and any other action does not raise this event. Hence there is no need to check it once again.
>> SendActionEvent() takes on the GetActionModifiers() which is kept as it.
>> Hope I answer your question. Have a good day Semyon.
>> Thanks and regards,
>>> On 04-Dec-2017, at 9:45 PM, Semyon Sadetsky <semyon.sadetsky at oracle.com> wrote:
>>> Hi Shashi,
>>> Shouldn't the BUTTON1_DOWN_MASK be added to the modifiers of the action?
>>> On 11/27/2017 09:16 PM, Shashidhara Veerabhadraiah wrote:
>>>> Hi Sergey, Here is the Webrev containing fixes for your comments.
>>>> Thanks and regards,
>>>> -----Original Message-----
>>>> From: Sergey Bylokhov
>>>> Sent: Wednesday, November 22, 2017 4:31 AM
>>>> To: Shashidhara Veerabhadraiah
>>>> <shashidhara.veerabhadraiah at oracle.com>; awt-dev at openjdk.java.net
>>>> Subject: Re:  JDK-8146537: TrayIcon Action Listener doesnt work
>>>> in WIndows 10
>>>> Hi, Shashi.
>>>> On 20/11/2017 02:10, Shashidhara Veerabhadraiah wrote:
>>>>> Summary: The windows GetKeyState() api provides the key state of
>>>>> the requested key as of that instant by sampling the current
>>>>> thread's key messages from the message queue. Any misses either a
>>>>> thread ran faster or slower it is possible to miss the key
>>>>> messages. This is the problem that's happening under windows 10
>>>>> wherein the key states are being null for the mouse button press.
>>>>> This problem is mentioned in the msdn as well. On the other hand, a
>>>>> tray icon message click produces NIN_BALLOONUSERCLICK event only
>>>>> upon the left mouse button click and hence there is no check required for the same.
>>>> The old code also request the state of the different keys like shift, control, etc. And after the fix we lose this information, probably we should apply it on top of the modifiers?
>>>> Another unclear thing is that we use
>>>> java_awt_event_InputEvent_BUTTON1_DOWN_MASK which is a mask for InputEvent as modifier for ActionEvent which does not have such mask.
>>>> Best regards, Sergey.
More information about the awt-dev