<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:"Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
{font-family:"Iosevka Fixed SS16";
panose-1:2 0 5 9 3 0 0 0 0 4;}
@font-face
{font-family:"Times New Roman \(Body CS\)";
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"\@Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Iosevka Fixed SS16";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">I agree - this makes sense.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">-andy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">From:
</span></b><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of John Hendrikx <john.hendrikx@gmail.com><br>
<b>Date: </b>Tuesday, December 26, 2023 at 21:54<br>
<b>To: </b>openjfx-dev@openjdk.org <openjfx-dev@openjdk.org><br>
<b>Subject: </b>Caret animation<o:p></o:p></span></p>
</div>
<p>In light of a possible future Behavior API, I took a close look at the "complicated" behaviors surrounding TextFields and TextAreas.<o:p></o:p></p>
<p>One thing that came out of this is that caret animation is controlled by the behaviors by looking at key presses and keys typed. It is a very convoluted way of doing this as there is a much simpler rule that governs caret animation:<o:p></o:p></p>
<p> <b>when the caret moves, animation should be reset</b><o:p></o:p></p>
<p>This is how controls do it in browsers and on Windows, and it makes much more sense. The caret only needs highlighting when it actually changed position, and can remain animated when it doesn't.<o:p></o:p></p>
<p>This also means that caret blinking can simply be a concern of the Skin, as it can listen for caret position changes. This also makes more sense. Replacing the Behavior but keeping the same Skin should not break caret blinking.<o:p></o:p></p>
<p>Currently, the behaviors will wrap all possible key pressed/typed events to stop the blinking, but it gets it wrong in many situations (when the caret didn't actually move, or when a key press was not consumed or didn't do anything, or using keypad navigation
which "forgets" to wrap it in the start/stop animation logic). It feels like a big hack when there is such an obvious alternative.<o:p></o:p></p>
<p>I've created this ticket to address this: <a href="https://bugs.openjdk.org/browse/JDK-8322748">
https://bugs.openjdk.org/browse/JDK-8322748</a><o:p></o:p></p>
<p>One of the immediate benefits (aside from solving all caret animation bugs) is probably a memory reduction as it removes a wrapper around every key press/type mapping...<o:p></o:p></p>
<p>--John<o:p></o:p></p>
<p><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>