Bug 428390

Summary: Adding widgets is difficult when focus follows mouse
Product: [Plasma] kwin Reporter: pat_h
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: minor CC: fella, kde, nate
Priority: NOR Keywords: usability
Version First Reported In: git master   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description pat_h 2020-10-28 13:15:12 UTC
SUMMARY
When trying to add a new widget to the task bar with Window activation policy "Focus follows mouse", the panel on the left (widget selection panel) closes before the mouse reaches it.

STEPS TO REPRODUCE
1. Go to System Settings → Window Management → Focus and set "Window activation policy to "Focus follows mouse" or "Focus follows mouse (mouse precedence)" and set "Delay focus by" to "0 ms"
2. Open two windows (does not matter which) one in the left screen half and one in the right one.
3. In the bottom panel (e.g. task bar – assuming a default panel layout) do a right mouse click somewhere in the right half of the panel → Add Widgets…
4. Move the mouse cursor to newly opened widgets panel on the left in a direct (i.e. diagonal towards the upper left screen corner) path.

OBSERVED RESULT
The Widgets panel closes before the mouse cursor reaches the widgets panel

EXPECTED RESULT
The Widgets panel is not closed by mouse movement. It gets only closed by using its usual mechanisms or by _clicking_ outside of the widgets panel.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon from 2020-10-25
(available in About System)
KDE Plasma Version: 5.20.80
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION
This bug is probably like one decade old, but I verified it with KDE neon Unstable.

The workaround is to move the mouse along the task bar to the left constantly keeping the mouse cursor above the the bottom or left widget panel.

I am not sure, if the behavior for all Plasma panels should be changed. After opening krunner it gets closed when moving the mouse around – not really logical, but most often not important because the fingers type on the keyboard anyway.
For the start menu it does not matter that much, as the mouse is there anyway, but "overshooting" the mouse movement closes the menu currently which is sometimes annoying.

So I think, that only closing widgets on click would be generally better behavior with "focus follows mouse", however the widget panel case is most important as opening action and panel can be so many window activations away regarding the mouse cursor path.

Kind regards
Patrick
Comment 1 pat_h 2020-10-29 14:50:36 UTC
It's definitely needed to fix the activity panel behavior, too, as there the same problem occurs. Clicking (or pressing for some people, I guess) the activity manager with the mouse cursor somewhere and moving it to the left gets it closed more often than not before reaching it.

So I guess the behavior should really be changed for all plasma panels (not closing them with focus follows mouse when moving the cursor around).

There is a difference between the active and the foreground window if I understood correctly. Maybe the fix is, that activation events should not close the panels, but foreground events should (if such concepts exist at all).
Comment 2 David Redondo 2024-06-12 09:37:38 UTC
I think with the edit mode rework this is fixed, I just tried it out