<AWT Dev>  JDK-8146537: TrayIcon Action Listener doesnt work in WIndows 10
shashidhara.veerabhadraiah at oracle.com
Wed Dec 6 04:13:50 UTC 2017
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 they only save the message. This part is kept same as earlier.
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
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