Bug 434657 - Tooltip window thumbnails sometimes disappear on hover
Summary: Tooltip window thumbnails sometimes disappear on hover
Status: RESOLVED FIXED
Alias: None
Product: libplasma
Classification: Frameworks and Libraries
Component: tooltips (show other bugs)
Version: 5.80.0
Platform: Debian unstable Linux
: NOR minor
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
: 436757 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-03-20 09:56 UTC by taerogar
Modified: 2021-10-14 17:38 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description taerogar 2021-03-20 09:56:31 UTC
VIDEO DEMONSTRATION
https://www.youtube.com/watch?v=zJQnrjJ7rAo

STEPS TO REPRODUCE
1. Open an application that plays media, like Spotify or a web browser.
2. Play music or video.
3. Minimize everything.
4. Hover or switch on other application not playing media.
5. Hover on application icon in task manager playing media.

OBSERVED RESULT
Tooltip window thumbnail, with media controls, disappears on hover. It usually sticks around after several attempts.

EXPECTED RESULT
Tooltip window thumbnail with media controls should remain on hover.

SOFTWARE/OS VERSIONS
Linux: Debian sid
KDE Plasma Version: 5.21.1
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Comment 1 Nate Graham 2021-03-21 00:01:42 UTC
Odd. Cannot reproduce. I notice that the media controls aren't visible like they should be. Do you see any errors printed to the console when you hover over one of these tooltips? You can run plasmashell in a terminal with `plasmashell --replace` to get this output printed to the console.
Comment 2 Bharadwaj Raju 2021-03-21 04:56:37 UTC
I can reproduce. No message is printed by Plasmashell. I tried putting some logging in the hideToolTipTemporarily function, also nothing. I tried to debug it by looking at events in GammaRay, but it's difficult to make much sense due to the hundreds of events per second happening. I'll keep trying though.

Possibly related: if you have a grouped task next to an unopened pinned task, and you hover over the unopened pinned task until its tooltip appears then hover over the grouped task, the tooltip disappears immediately.
Comment 3 taerogar 2021-03-21 05:16:16 UTC
(In reply to Nate Graham from comment #1)
> Odd. Cannot reproduce. I notice that the media controls aren't visible like
> they should be. Do you see any errors printed to the console when you hover
> over one of these tooltips? You can run plasmashell in a terminal with
> `plasmashell --replace` to get this output printed to the console.

No relevant logs were observed when running plasmashell --replace from the terminal.

I uploaded another video demonstrating the disappearing tooltip window thumbnail, with the terminal visible on the upper right.

https://www.youtube.com/watch?v=gNgDsxhhmfU
Comment 4 Nate Graham 2021-03-21 12:02:58 UTC
Thanks. It does not look related to the media controls.

Are you using any non-default task manager or focus changes? For example focus follows mouse, or unusually low or high focus stealing prevention settings?
Comment 5 taerogar 2021-03-21 15:28:24 UTC
(In reply to Nate Graham from comment #4)
> Thanks. It does not look related to the media controls.
> 
> Are you using any non-default task manager or focus changes? For example
> focus follows mouse, or unusually low or high focus stealing prevention
> settings?

I'm using the Icons-only Task Manager that comes with Plasma. Regarding focus stealing prevention settings, I don't recall configuring, or knowing of such thing at the moment. I have 'Display informational tooltips on mouse hover' enabled from System Settings > Workspace Behavior > General Behavior, if it is any help.
Comment 6 Bharadwaj Raju 2021-03-21 15:56:47 UTC
(In reply to Nate Graham from comment #4)
> Thanks. It does not look related to the media controls.

I have so far only seen it with windows which have a media control...

> Are you using any non-default task manager or focus changes? For example
> focus follows mouse, or unusually low or high focus stealing prevention
> settings?

I can reproduce with focus stealing protection set to default Low, and with it set to High.
Comment 7 Nate Graham 2021-03-21 16:05:37 UTC
We can see it happening to Kate's tooltip at 0:53 in the latest video, and Kate doesn't have any media functionality.
Comment 8 taerogar 2021-03-21 16:15:20 UTC
I uploaded another video in case it could be of help.

https://www.youtube.com/watch?v=zRYbTC0N0fQ
Comment 9 Bharadwaj Raju 2021-03-23 11:46:20 UTC
I think I found out what causes this.

How to reproduce reliably:
Hover over a pinned app, see the tooltip, then move mouse away from panel. now move mouse onto an open window thing, and the tooltip reliably disappears.

Cause:
plasma-framework/src/declarativeimports/core/tooltipdialog.cpp function ToolTipDialog::event receives spurious Leave events. Possibly events from the old tooltip manifesting now? I think so because ToolTip::hoverLeaveEvent is not fired.
Comment 10 Nate Graham 2021-03-23 12:27:52 UTC
Makes sense. Please do feel free to debug a bit more and submit a merge request. Thanks so much for all you're doing to make KDE software better for humanity!
Comment 11 Bharadwaj Raju 2021-03-24 04:36:11 UTC
https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/393

I mentioned this bug in the commit message but Bugzilla bot didn't pick up on it. Anyway, this MR fixes the bug.
Comment 12 Nate Graham 2021-04-23 14:51:13 UTC
Git commit aff12784a17d3ffefffac786bc3c3c99dbb217db by Nate Graham, on behalf of Bharadwaj Raju.
Committed on 23/04/2021 at 14:50.
Pushed by ngraham into branch 'master'.

Use independent toolTipDelegate for each item.

M  +5    -0    applets/taskmanager/package/contents/ui/Task.qml
M  +0    -7    applets/taskmanager/package/contents/ui/main.qml
M  +24   -23   applets/taskmanager/plugin/backend.cpp
M  +0    -7    applets/taskmanager/plugin/backend.h

https://invent.kde.org/plasma/plasma-desktop/commit/aff12784a17d3ffefffac786bc3c3c99dbb217db
Comment 13 Nate Graham 2021-05-12 13:18:41 UTC
*** Bug 436757 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2021-10-14 17:38:07 UTC
Git commit 2355c4182e510ed3069a3f7b37ded5008b5ee2fa by Nate Graham, on behalf of Fushan Wen.
Committed on 14/10/2021 at 17:37.
Pushed by ngraham into branch 'master'.

Prevent tooltips from being incorrectly dismissed

Having a single shared ToolTipDelegate causes problems with Dialog
positioning when the size changes significantly.

The sequence of widget events when the bug is triggered is:

1. QEvent::Resize (Size is changed)
2. QEvent::Move (Position is changed, but the vertical coordinate is not)
3. QEvent::Leave (Therefore some tooltips are incorrectly dismissed)

Add m_extendTimeoutFlag to prevent interactive tooltips from being
incorrectly dismissed.
Related: bug 439522

M  +21   -3    src/declarativeimports/core/tooltipdialog.cpp
M  +9    -0    src/declarativeimports/core/tooltipdialog.h

https://invent.kde.org/frameworks/plasma-framework/commit/2355c4182e510ed3069a3f7b37ded5008b5ee2fa