Bug 438950

Summary: Triangle menu idle-hover reset doesn't work in kickoff
Product: [Plasma] plasmashell Reporter: rohit <rohitprasad1323>
Component: Application Launcher (Kickoff)Assignee: David Edmundson <kde>
Status: RESOLVED FIXED    
Severity: normal CC: alois1, bharadwaj.raju777, blood990, bugseforuns, christ.derek, eduardo.cruz, kroot001, med.medin.2014, mikel5764, nate, plasma-bugs, ritalat, tk20
Priority: HI Keywords: usability
Version: 5.22.2   
Target Milestone: 1.0   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: kickoff doesn't switches to the first few application categories instantly

Description rohit 2021-06-20 14:30:21 UTC
Created attachment 139542 [details]
kickoff doesn't switches to the first few application categories instantly

SUMMARY
When I click on the Kickoff menu plasmoid and hover over the first few application categories it doesn't switches to first few categories instantly 

STEPS TO REPRODUCE
1 move your default plasma panel to the left side of the screen
2 click on the application launcher and hover on the first few application categories, it doesn't switch to the first few categories instantly

OBSERVED RESULT
kickoff doesn't switches to the first few application categories instantly

EXPECTED RESULT
kickoff should switch to the first few application categories instantly

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.22
KDE Plasma Version: 5.22.1
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.3
ADDITIONAL INFORMATION
I have attached a screen recording
Comment 1 Patrick Silva 2021-06-21 15:55:23 UTC
This behavior also occurs on Plasma 5.22.1 with horizontal panel on bottom.
If I move cursor diagonally after opening kickoff, apps from hovered category are not shown. Then I move cursor horizontally on the category initially hovered
and its apps are listed in the right side as expected.
If I move cursor vertically after opening kickoff, kickoff immediately
lists the apps from hovered category in the right side.
Comment 2 Alois Wohlschlager 2021-06-23 13:49:40 UTC
I can confirm this behavior when moving the mouse slightly diagonally. I think this is the triangle filter being a bit too eager to think the user wants to move the mouse to the application list on the right.
Comment 3 Topi 2021-06-28 04:04:04 UTC
Category switching definitely feels sluggish and inconsistent.
Comment 4 Patrick Silva 2021-07-18 17:52:35 UTC
*** Bug 440009 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2021-07-23 16:34:02 UTC
Yes, this is the triangle filter. If you move your cursor diagonally, the hover event gets eaten if the vector along which you're moving the cursor could end in a clickable item in the main view. This is how triangle filters work and it is something we can't remove because we had approximately five billion complains about how hover used to work, which were resolved by implementing it.

However, looking at how other triangle menu filters are implemented, I think what we're missing is a velocity heuristic. Our implementation is purely direction-based; if you move the cursor diagonally very slowly and even stop moving it entirely, the event still gets eaten. Other implementations allow the event through if the speed is low or the cursor stops moving.

I think a minimum velocity for the filter would improve the situation.
Comment 6 David Edmundson 2021-07-23 17:22:23 UTC
>Other implementations allow the event through if the speed is low or the cursor stops moving.

We do have code in the triangle filter to replay an event if the cursor stops moving, by default for 300ms. See filterTimeOut/m_resetTimer

That works in the unit test, but the unit test is rather different to what Kicker has which only has one MouseArea for the whole thing. It does appear to have something slightly off.
Comment 7 Nate Graham 2021-07-23 18:08:08 UTC
Yeah that doesn't seem to be working for me. If I move the cursor diagonally but stop it over a list item, that item never gets selected.
Comment 8 Patrick Silva 2021-10-14 18:43:09 UTC
*** Bug 443714 has been marked as a duplicate of this bug. ***
Comment 9 David Edmundson 2021-10-16 23:00:57 UTC
Lets fix the bug with the staying still before we start coming up with new requirements about velocity. I'll rename the bug.
Comment 10 Patrick Silva 2021-12-10 20:34:22 UTC
*** Bug 446778 has been marked as a duplicate of this bug. ***
Comment 11 Patrick Silva 2021-12-18 22:45:20 UTC
*** Bug 447188 has been marked as a duplicate of this bug. ***
Comment 12 Nate Graham 2022-07-05 17:07:39 UTC
*** Bug 447278 has been marked as a duplicate of this bug. ***
Comment 13 Bug Janitor Service 2022-09-10 20:52:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2100
Comment 14 Nate Graham 2022-09-11 23:49:12 UTC
Raising priority due to number of duplicates.
Comment 15 Nate Graham 2022-10-03 08:15:25 UTC
Git commit f332b03c18f1fa71d4ced051b1289b4cb4513cc1 by Nate Graham, on behalf of Derek Christ.
Committed on 03/10/2022 at 07:52.
Pushed by ngraham into branch 'master'.

apples/kicker: fix timer in triangular mouse filter.

The underlying mouse area for kickoff list delegates does not select
items when the mouse enters the hovering area, but when the mouse
changes its position.
Therefore, to change the current selected item, the triangular mouse
filter must replay both enter and move events when the triangular
fitlering condition is broken.

Sometimes, it was possible that the filter only let trough an enter
and no following move event, that results in the current hovered item
not selected even when the mouse stops its movement completely.

The timeout timer that is used to select the hovered item after a time
was not at fault, because it is only responsible to do so when the
triangular filtering condition is currently upheld, which is not the
case in the above mentioned example.

M  +15   -5    applets/kicker/plugin/trianglemousefilter.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/f332b03c18f1fa71d4ced051b1289b4cb4513cc1
Comment 16 Nate Graham 2022-10-03 08:16:45 UTC
Git commit 0661321622cb10e04e621319d7f697d4b97402b0 by Nate Graham, on behalf of Derek Christ.
Committed on 03/10/2022 at 08:16.
Pushed by ngraham into branch 'Plasma/5.26'.

apples/kicker: fix timer in triangular mouse filter.

The underlying mouse area for kickoff list delegates does not select
items when the mouse enters the hovering area, but when the mouse
changes its position.
Therefore, to change the current selected item, the triangular mouse
filter must replay both enter and move events when the triangular
fitlering condition is broken.

Sometimes, it was possible that the filter only let trough an enter
and no following move event, that results in the current hovered item
not selected even when the mouse stops its movement completely.

The timeout timer that is used to select the hovered item after a time
was not at fault, because it is only responsible to do so when the
triangular filtering condition is currently upheld, which is not the
case in the above mentioned example.


(cherry picked from commit f332b03c18f1fa71d4ced051b1289b4cb4513cc1)

M  +15   -5    applets/kicker/plugin/trianglemousefilter.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/0661321622cb10e04e621319d7f697d4b97402b0
Comment 17 Bharadwaj Raju 2022-11-03 18:20:42 UTC
Reopening -- the fix caused other, more serious problems and has been reverted for now. Hopefully someone can come up with a better solution.
Comment 18 Nate Graham 2022-11-19 04:52:13 UTC
That fix was reverted, but I can't reproduce the issue anymore in current git master, so maybe something else fixed it. Can anyone else confirm?
Comment 19 Derek Christ 2022-11-19 18:45:09 UTC
(In reply to Nate Graham from comment #18)
> That fix was reverted, but I can't reproduce the issue anymore in current
> git master, so maybe something else fixed it. Can anyone else confirm?

I can still reproduce the bug on latest master.
Comment 20 Nate Graham 2022-11-21 21:14:10 UTC
Weird, I can't. When I move my cursor diagonally to trigger the triangle filter to not switch categories, it indeed does not switch categories. But then when the cursor steps for a moment, it switches to whatever category the cursor is over.

Are you not seeing that?
Comment 21 Derek Christ 2022-11-21 22:01:39 UTC
(In reply to Nate Graham from comment #20)
> Weird, I can't. When I move my cursor diagonally to trigger the triangle
> filter to not switch categories, it indeed does not switch categories. But
> then when the cursor steps for a moment, it switches to whatever category
> the cursor is over.
> 
> Are you not seeing that?

Yes, in general the timeout of the mouse filter works. But sometimes it happens that a selection is not made, although the timer should have expired.
This happens mostly when you make a fast jerky movement diagonally to the upper left.
I have described why this happens in more detail in https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2100.
Comment 22 Nate Graham 2022-11-22 18:48:47 UTC
> This happens mostly when you make a fast jerky movement diagonally to the upper left.

That seems like a different issue; moving to top left should not trigger the triangle menu logic in the first place, and categories should be highlighted on hover. This works for me FWIW.
Comment 23 Derek Christ 2022-11-22 20:39:11 UTC
(In reply to Nate Graham from comment #22)
> > This happens mostly when you make a fast jerky movement diagonally to the upper left.
> 
> That seems like a different issue; moving to top left should not trigger the
> triangle menu logic in the first place, and categories should be highlighted
> on hover. This works for me FWIW.

You're technically correct. We would then need to create a new bug report for this other issue.
Comment 24 Nate Graham 2022-11-22 21:21:02 UTC
Sounds good, let's do that.
Comment 25 Derek Christ 2022-11-26 15:04:38 UTC
(In reply to Nate Graham from comment #24)
> Sounds good, let's do that.

Done with 462271