[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: D5490: Only follow mouse when moved (Fixes Bug #372635)
From: Aetf <noreply () phabricator ! kde ! org>
Date: 2017-04-20 19:27:57
Message-ID: 20170420192756.39051.63126.EE47B1A0 () phabricator ! kde ! org
[Download RAW message or body]
qi437103 added a comment.
Sorry I should have been more specific.
The difference between these two situation is whether the mouse position in global \
coordinate changed.
Inside `onContainsMouseChanged`, if `containsMouse`
- If `moved`, select current index
- Else if global mouse pos changed, set `moved = true` and select current index
- Else, do nothing
Inside `onPositionChanged`,
- If `!moved` and global mouse pos changed, set `moved = true` and select current \
index
The initial global mouse pos could be recorded at the same time as initializing \
`moved = false`.
This covers the following situation:
- Initially mouse is outside the window, it becomes inside the window because of \
the height change.
- Triggers `onContainsMouseChanged`, as the global mouse pos didn't change, it \
does nothing
- Not sure if this triggers `onPositionChanged`, but it also does nothing because \
the check of global mouse pos
- Initially mouse is outside the window, it becomes inside the window because the \
user moved it.
- This triggers both `onPositionChanged` and `onContainsMouseChanged`. The global \
mouse pos changed, current index selected.
- 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
- Triggers `onPositionChanged`. The global mouse pos changed, current index \
selected.
REPOSITORY
R112 Milou
REVISION DETAIL
https://phabricator.kde.org/D5490
To: leszeklesner, broulik
Cc: ltoscano, qi437103, lfurmetz, anthonyfieroni, davidedmundson, plasma-devel, \
spstarr, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol
[Attachment #3 (text/html)]
<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>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic