<table><tr><td style="">qi437103 added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D5490" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Sorry I should have been more specific.</p>
<p>The difference between these two situation is whether the mouse position in global coordinate changed.</p>
<p>Inside <tt style="background: #ebebeb; font-size: 13px;">onContainsMouseChanged</tt>, if <tt style="background: #ebebeb; font-size: 13px;">containsMouse</tt></p>
<ul class="remarkup-list">
<li class="remarkup-list-item">If <tt style="background: #ebebeb; font-size: 13px;">moved</tt>, select current index</li>
<li class="remarkup-list-item">Else if global mouse pos changed, set <tt style="background: #ebebeb; font-size: 13px;">moved = true</tt> and select current index</li>
<li class="remarkup-list-item">Else, do nothing</li>
</ul>
<p>Inside <tt style="background: #ebebeb; font-size: 13px;">onPositionChanged</tt>,</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">If <tt style="background: #ebebeb; font-size: 13px;">!moved</tt> and global mouse pos changed, set <tt style="background: #ebebeb; font-size: 13px;">moved = true</tt> and select current index</li>
</ul>
<p>The initial global mouse pos could be recorded at the same time as initializing <tt style="background: #ebebeb; font-size: 13px;">moved = false</tt>.</p>
<p>This covers the following situation:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Initially mouse is outside the window, it becomes inside the window because of the height change.<ul class="remarkup-list">
<li class="remarkup-list-item">Triggers <tt style="background: #ebebeb; font-size: 13px;">onContainsMouseChanged</tt>, as the global mouse pos didn't change, it does nothing</li>
<li class="remarkup-list-item">Not sure if this triggers <tt style="background: #ebebeb; font-size: 13px;">onPositionChanged</tt>, but it also does nothing because the check of global mouse pos</li>
</ul></li>
<li class="remarkup-list-item">Initially mouse is outside the window, it becomes inside the window because the user moved it.<ul class="remarkup-list">
<li class="remarkup-list-item">This triggers both <tt style="background: #ebebeb; font-size: 13px;">onPositionChanged</tt> and <tt style="background: #ebebeb; font-size: 13px;">onContainsMouseChanged</tt>. The global mouse pos changed, current index selected.</li>
</ul></li>
<li class="remarkup-list-item">After mouse becomes inside the window because of height change, and is on some list item A, the user moves mouse within list item A<ul class="remarkup-list">
<li class="remarkup-list-item">Triggers <tt style="background: #ebebeb; font-size: 13px;">onPositionChanged</tt>. The global mouse pos changed, current index selected.</li>
</ul></li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R112 Milou</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D5490" rel="noreferrer">https://phabricator.kde.org/D5490</a></div></div><br /><div><strong>To: </strong>leszeklesner, broulik<br /><strong>Cc: </strong>ltoscano, qi437103, lfurmetz, anthonyfieroni, davidedmundson, plasma-devel, spstarr, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol<br /></div>