<AWT Dev> Unwanted MOUSE_MOVED break dispatching MOUSE_RELEASED to the right component

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

<AWT Dev> Unwanted MOUSE_MOVED break dispatching MOUSE_RELEASED to the right component

Weidemann, Matthias

Hello everyone,

 

we found a rare occurrence of a bug in JDK1.8 and onwards, might also occur earlier but we didn’t check for that.

 

In some instances MOUSE_MOVED events occur between a MOUSE_PRESSED and a MOUSE_RELEASED. In Container.java on MOUSE_PRESSED the component is remembered in an instance variable to send a corresponding MOUSE_RELEASED to it.

The same instance variable is used for the MOUSE_MOVED Event, so if there are MOUSE_MOVED Events between a MOUSE_PRESSED and MOUSE_RELEASED the corresponding MOUSE_RELEASE will be reported to the "wrong" component.

 

I attached a simple example to replicate the error.

 

I included hardware specifications, because the occurrence fluctuates with the hardware used. We got the best results to reproduce with the Macbook and the magic mouse shown below. With a trackpad it is almost impossible to replicate.

 

 

 

 

How to: Move the mouse in the blue rectangle VERY FAST from left to right or vice versa. Release the mousebutton near the end of the drag, while you are still in motion.

 

We are using a workaround for this, the same custom queue built into the example. If we are between MOUSE_PRESSED and MOUSE_RELEASED we do not dispatch MOUSE_MOVED Events.

We would still like to see this bug fixed or at least have different instance variables for MOUSE_PRESSED and MOUSE_MOVED so we get the MOUSE_RELEASE on the right component.

 

Kind Regards,

Matthias Weidemann

 

Matthias Weidemann
Software Developer, PI Technology UxP UI P&S (SE) Supp
SAP SE
, Opelstr. 6, 68789 St. Leon - Rot, Germany

T +49 6227 7-45771 , E matthias.[hidden email]


Please consider the impact on the environment before printing this e-mail.


Pflichtangaben/Mandatory Disclosure Statement:
http://www.sap.com/company/legal/impressum.epx/ 

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail.
Vielen Dank. 

This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal.
Thank you for your cooperation

 


MouseMotionBugGui.java (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> Unwanted MOUSE_MOVED break dispatching MOUSE_RELEASED to the right component

Semyon Sadetsky

Hi Matthias,

Thank you for your e-mail.

It seems a fix for this bug is already under discussion on this thread:

http://mail.openjdk.java.net/pipermail/swing-dev/2017-December/008077.html

--Semyon


On 01/04/2018 04:56 AM, Weidemann, Matthias wrote:

Hello everyone,

 

we found a rare occurrence of a bug in JDK1.8 and onwards, might also occur earlier but we didn’t check for that.

 

In some instances MOUSE_MOVED events occur between a MOUSE_PRESSED and a MOUSE_RELEASED. In Container.java on MOUSE_PRESSED the component is remembered in an instance variable to send a corresponding MOUSE_RELEASED to it.

The same instance variable is used for the MOUSE_MOVED Event, so if there are MOUSE_MOVED Events between a MOUSE_PRESSED and MOUSE_RELEASED the corresponding MOUSE_RELEASE will be reported to the "wrong" component.

 

I attached a simple example to replicate the error.

 

I included hardware specifications, because the occurrence fluctuates with the hardware used. We got the best results to reproduce with the Macbook and the magic mouse shown below. With a trackpad it is almost impossible to replicate.

 

 

 

 

How to: Move the mouse in the blue rectangle VERY FAST from left to right or vice versa. Release the mousebutton near the end of the drag, while you are still in motion.

 

We are using a workaround for this, the same custom queue built into the example. If we are between MOUSE_PRESSED and MOUSE_RELEASED we do not dispatch MOUSE_MOVED Events.

We would still like to see this bug fixed or at least have different instance variables for MOUSE_PRESSED and MOUSE_MOVED so we get the MOUSE_RELEASE on the right component.

 

Kind Regards,

Matthias Weidemann

 

Matthias Weidemann
Software Developer, PI Technology UxP UI P&S (SE) Supp
SAP SE
, Opelstr. 6, 68789 St. Leon - Rot, Germany

T +49 6227 7-45771 , E matthias.[hidden email]


Please consider the impact on the environment before printing this e-mail.


Pflichtangaben/Mandatory Disclosure Statement:
http://www.sap.com/company/legal/impressum.epx/ 

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail.
Vielen Dank. 

This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal.
Thank you for your cooperation

 


Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> Unwanted MOUSE_MOVED break dispatching MOUSE_RELEASED to the right component

Weidemann, Matthias

Hello Sadetsky,

 

The discussion you linked to me seems to be a similar problem, but the fix discussed there happens specifically in the method Container.retargetMouseEnterExit(…). The problem we have happens in MOUSE_MOVED, so while this fix might fix the problem in the discussion it won’t fix ours.

 

Kind Regards,

Matthias

 

From: Semyon Sadetsky <[hidden email]>
Date: Monday, January 8, 2018 at 10:55 PM
To: "Weidemann, Matthias" <[hidden email]>, "[hidden email]" <[hidden email]>
Cc: "Woersinger, Rolf-Martin" <[hidden email]>, "Denkel, Christian" <[hidden email]>
Subject: Re: <AWT Dev> Unwanted MOUSE_MOVED break dispatching MOUSE_RELEASED to the right component

 

Hi Matthias,

Thank you for your e-mail.

It seems a fix for this bug is already under discussion on this thread:

http://mail.openjdk.java.net/pipermail/swing-dev/2017-December/008077.html

--Semyon

 

On 01/04/2018 04:56 AM, Weidemann, Matthias wrote:

Hello everyone,

 

we found a rare occurrence of a bug in JDK1.8 and onwards, might also occur earlier but we didn’t check for that.

 

In some instances MOUSE_MOVED events occur between a MOUSE_PRESSED and a MOUSE_RELEASED. In Container.java on MOUSE_PRESSED the component is remembered in an instance variable to send a corresponding MOUSE_RELEASED to it.

The same instance variable is used for the MOUSE_MOVED Event, so if there are MOUSE_MOVED Events between a MOUSE_PRESSED and MOUSE_RELEASED the corresponding MOUSE_RELEASE will be reported to the "wrong" component.

 

I attached a simple example to replicate the error.

 

I included hardware specifications, because the occurrence fluctuates with the hardware used. We got the best results to reproduce with the Macbook and the magic mouse shown below. With a trackpad it is almost impossible to replicate.

 

 

 

 

How to: Move the mouse in the blue rectangle VERY FAST from left to right or vice versa. Release the mousebutton near the end of the drag, while you are still in motion.

 

We are using a workaround for this, the same custom queue built into the example. If we are between MOUSE_PRESSED and MOUSE_RELEASED we do not dispatch MOUSE_MOVED Events.

We would still like to see this bug fixed or at least have different instance variables for MOUSE_PRESSED and MOUSE_MOVED so we get the MOUSE_RELEASE on the right component.

 

Kind Regards,

Matthias Weidemann

 

Matthias Weidemann
Software Developer, PI Technology UxP UI P&S (SE) Supp
SAP SE
, Opelstr. 6, 68789 St. Leon - Rot, Germany

T +49 6227 7-45771 , E matthias.[hidden email]


Please consider the impact on the environment before printing this e-mail.


Pflichtangaben/Mandatory Disclosure Statement:
http://www.sap.com/company/legal/impressum.epx/ 

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail.
Vielen Dank. 

This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal.
Thank you for your cooperation

 



Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> Unwanted MOUSE_MOVED break dispatching MOUSE_RELEASED to the right component

Semyon Sadetsky

Hello Matthias,

If so, please, file a bug to https://bugreport.java.com/

--Semyon


On 01/09/2018 12:09 AM, Weidemann, Matthias wrote:

Hello Sadetsky,

 

The discussion you linked to me seems to be a similar problem, but the fix discussed there happens specifically in the method Container.retargetMouseEnterExit(…). The problem we have happens in MOUSE_MOVED, so while this fix might fix the problem in the discussion it won’t fix ours.

 

Kind Regards,

Matthias

 

From: Semyon Sadetsky [hidden email]
Date: Monday, January 8, 2018 at 10:55 PM
To: "Weidemann, Matthias" [hidden email], [hidden email] [hidden email]
Cc: "Woersinger, Rolf-Martin" [hidden email], "Denkel, Christian" [hidden email]
Subject: Re: <AWT Dev> Unwanted MOUSE_MOVED break dispatching MOUSE_RELEASED to the right component

 

Hi Matthias,

Thank you for your e-mail.

It seems a fix for this bug is already under discussion on this thread:

http://mail.openjdk.java.net/pipermail/swing-dev/2017-December/008077.html

--Semyon

 

On 01/04/2018 04:56 AM, Weidemann, Matthias wrote:

Hello everyone,

 

we found a rare occurrence of a bug in JDK1.8 and onwards, might also occur earlier but we didn’t check for that.

 

In some instances MOUSE_MOVED events occur between a MOUSE_PRESSED and a MOUSE_RELEASED. In Container.java on MOUSE_PRESSED the component is remembered in an instance variable to send a corresponding MOUSE_RELEASED to it.

The same instance variable is used for the MOUSE_MOVED Event, so if there are MOUSE_MOVED Events between a MOUSE_PRESSED and MOUSE_RELEASED the corresponding MOUSE_RELEASE will be reported to the "wrong" component.

 

I attached a simple example to replicate the error.

 

I included hardware specifications, because the occurrence fluctuates with the hardware used. We got the best results to reproduce with the Macbook and the magic mouse shown below. With a trackpad it is almost impossible to replicate.

 

 

 

 

How to: Move the mouse in the blue rectangle VERY FAST from left to right or vice versa. Release the mousebutton near the end of the drag, while you are still in motion.

 

We are using a workaround for this, the same custom queue built into the example. If we are between MOUSE_PRESSED and MOUSE_RELEASED we do not dispatch MOUSE_MOVED Events.

We would still like to see this bug fixed or at least have different instance variables for MOUSE_PRESSED and MOUSE_MOVED so we get the MOUSE_RELEASE on the right component.

 

Kind Regards,

Matthias Weidemann

 

Matthias Weidemann
Software Developer, PI Technology UxP UI P&S (SE) Supp
SAP SE
, Opelstr. 6, 68789 St. Leon - Rot, Germany

T +49 6227 7-45771 , E matthias.[hidden email]


Please consider the impact on the environment before printing this e-mail.


Pflichtangaben/Mandatory Disclosure Statement:
http://www.sap.com/company/legal/impressum.epx/ 

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail.
Vielen Dank. 

This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal.
Thank you for your cooperation