RFR: 8319880: JTextField text selection doesn't stop if ended during loss of window focus [v3]
Anass Baya
abaya at openjdk.org
Wed Dec 3 10:56:24 UTC 2025
> **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
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28582/files
- new: https://git.openjdk.org/jdk/pull/28582/files/0d4722dc..da7ce5ef
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28582&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28582&range=01-02
Stats: 24 lines in 1 file changed: 1 ins; 14 del; 9 mod
Patch: https://git.openjdk.org/jdk/pull/28582.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28582/head:pull/28582
PR: https://git.openjdk.org/jdk/pull/28582
More information about the client-libs-dev
mailing list