D5490: Only follow mouse when moved (Fixes Bug #372635)

Aetf noreply at phabricator.kde.org
Thu Apr 20 19:27:57 UTC 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170420/191a21b4/attachment.html>


More information about the Plasma-devel mailing list