On Wed, 3 Dec 2025 10:56:24 GMT, Anass Baya <[email protected]> wrote:

>> **Analysis :** 
>> The issue is that on Win32, if the window is not active, we dont receive 
>> mouse events because we release the capture
>>  So the problem is the following:
>> We start selecting text from the right to the extreme left.
>> Then we switch to another window( the window lose focus ), and we release 
>> the mouse
>> But when we return to the window, the caret drag is still active and does 
>> not stop. as the window did not recieved the mouse release event
>> 
>> **Proposed fix:**
>> In the Caret class, we added a logic to ignore the drag if the focus was 
>> lost due to window switching unless a new mouse press happens
>
> Anass Baya has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   The issue occurs only on Wnidows

test/jdk/javax/swing/JTextField/TextSelectionFocusLoss/TextSelectionFocusLoss.java
 line 72:

> 70:             robot.delay(500);
> 71: 
> 72:             Point location = textField.getLocationOnScreen();

These calls are still need to happen on EDT.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28582#discussion_r2586688264

Reply via email to