Bug 417939 - Task context menu disappears when Task's tooltip disappears
Summary: Task context menu disappears when Task's tooltip disappears
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.18.1
Platform: Archlinux Linux
: VHI normal
Target Milestone: 1.0
Assignee: David Edmundson
URL: https://codereview.qt-project.org/c/q...
Keywords: wayland
: 421602 421635 423357 426545 426994 429750 431147 431409 431932 432024 432079 433861 441941 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-02-20 16:04 UTC by Patrick Silva
Modified: 2021-10-20 17:16 UTC (History)
29 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.23


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2020-02-20 16:04:30 UTC
STEPS TO REPRODUCE
1. start Wayland session
2. open any window
3. hover over its entry in task manager and immediately right-click on it

OBSERVED RESULT
context menu and tooltip of the entry in task manager show up together, tooltip overlaps the context menu.

EXPECTED RESULT
tooltip should not overlap the context menu

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.18.1
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Comment 1 Patrick Silva 2020-05-16 23:11:27 UTC
*** Bug 421635 has been marked as a duplicate of this bug. ***
Comment 2 Méven Car 2020-05-17 05:23:16 UTC
Bug is reported upstream to Qt https://bugreports.qt.io/browse/QTBUG-83972
Comment 3 Nate Graham 2020-05-18 14:44:21 UTC
So is this 100% an upstream issue? Should we close the bug report?
Comment 4 Patrick Silva 2020-06-23 16:51:50 UTC
*** Bug 423357 has been marked as a duplicate of this bug. ***
Comment 5 Patrick Silva 2020-09-15 02:57:43 UTC
*** Bug 426545 has been marked as a duplicate of this bug. ***
Comment 6 Patrick Silva 2020-09-27 15:25:32 UTC
*** Bug 426994 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2021-03-04 20:17:27 UTC
Oh, this is the issue where the tooltip closes along with the context menu. We have a bunch of bugs on that somewhere else, Let me mark them as duped of the same master bug.
Comment 8 Nate Graham 2021-03-04 20:23:26 UTC
Oh wait, this was it lol
Comment 9 Nate Graham 2021-03-04 20:25:20 UTC
*** Bug 416869 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2021-03-04 20:25:25 UTC
*** Bug 421602 has been marked as a duplicate of this bug. ***
Comment 11 Nate Graham 2021-03-04 20:25:32 UTC
*** Bug 431932 has been marked as a duplicate of this bug. ***
Comment 12 Nate Graham 2021-03-04 20:25:38 UTC
*** Bug 432024 has been marked as a duplicate of this bug. ***
Comment 13 Nate Graham 2021-03-04 20:25:45 UTC
*** Bug 432079 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2021-03-20 02:54:13 UTC
*** Bug 427542 has been marked as a duplicate of this bug. ***
Comment 15 Nate Graham 2021-04-23 20:17:52 UTC
Wow, this is really annoying. No wonder we have so many duplicate bug reports. Raising the priority accordingly.
Comment 16 twinshadows404 2021-04-23 23:26:57 UTC
*** Bug 433861 has been marked as a duplicate of this bug. ***
Comment 17 Nate Graham 2021-04-24 13:46:38 UTC
*** Bug 431147 has been marked as a duplicate of this bug. ***
Comment 18 Maugre 2021-04-24 15:02:31 UTC
*** Bug 429750 has been marked as a duplicate of this bug. ***
Comment 19 Vlad Zahorodnii 2021-04-26 07:01:30 UTC
plasma is the one who dismisses the context menu. moving the bug report to plasmashell as my knowledge of plasma's internals is limited and we can't fix this bug in kwin.
Comment 21 Brian 2021-04-26 15:02:39 UTC
(In reply to Vlad Zahorodnii from comment #20)
> https://invent.kde.org/qt/qt/qtwayland/-/blob/
> 00b9c558886945bd9b37671732d14e3982fe3da5/src/client/qwaylandwindow.cpp#L459
> 
> It looks like QtWaylandClient is at fault!

Do you think you could try fixing it? This bug is basically a showstopper for Wayland.
Comment 22 Bug Janitor Service 2021-04-26 16:28:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/903
Comment 23 Martin Stockhammer 2021-05-02 16:29:25 UTC
Can confirm this with Plasma 5.21.4 on Wayland
Comment 24 Bug Janitor Service 2021-05-05 14:28:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/451
Comment 25 Vlad Zahorodnii 2021-05-05 18:49:07 UTC
Potential upstream fix: https://codereview.qt-project.org/c/qt/qtwayland/+/347783
Comment 26 Patrick Silva 2021-05-14 19:36:53 UTC
*** Bug 431409 has been marked as a duplicate of this bug. ***
Comment 27 tromzy 2021-05-17 08:16:26 UTC
The situation is better on Plasma 5.22 beta, but still not perfect : when I right click an entry in the Task Manager :

- if the right click menu pops in front of the window thumbnail, then the right click menu does not vanish before I can click anything on it (good behaviour)

- if the window thumbnail pops in front of the right click menu, then the right click menu vanishes at the same time than the thumbnail, making it impossible to click anything on it.
Comment 28 David Redondo 2021-05-17 13:07:26 UTC
Git commit d24ab7b5a7fc127f7278be79ef49f9a028358d01 by David Redondo.
Committed on 17/05/2021 at 10:34.
Pushed by davidre into branch 'master'.

Hide tooltip window immediately before opening context menu

Tooltip internally uses TooltipDialog (a QWindow subclass)  which runs a timer
before it hides itself. This is done so it can be reused and to prevent flickering
when switching between Tooltips quickly. However here it causes an issue, when
closing a popup on Wayland, Qt closes all popups that were opened after it. This means
when openening a ContextMenu while a Tooltip is shown, the TooltipDialog will hide
itself *after* the window of the context menu has been created and close it in the
process.
As a workaround we can hide the window manually before creating the context menu.
FIXED-IN:5.22

M  +3    -0    applets/taskmanager/package/contents/ui/Task.qml

https://invent.kde.org/plasma/plasma-desktop/commit/d24ab7b5a7fc127f7278be79ef49f9a028358d01
Comment 29 David Redondo 2021-05-17 13:07:53 UTC
Git commit db44453430f6684df06cc1f9c42b3a7eb4b16b86 by David Redondo.
Committed on 17/05/2021 at 13:07.
Pushed by davidre into branch 'Plasma/5.22'.

Hide tooltip window immediately before opening context menu

Tooltip internally uses TooltipDialog (a QWindow subclass)  which runs a timer
before it hides itself. This is done so it can be reused and to prevent flickering
when switching between Tooltips quickly. However here it causes an issue, when
closing a popup on Wayland, Qt closes all popups that were opened after it. This means
when openening a ContextMenu while a Tooltip is shown, the TooltipDialog will hide
itself *after* the window of the context menu has been created and close it in the
process.
As a workaround we can hide the window manually before creating the context menu.
FIXED-IN:5.22


(cherry picked from commit d24ab7b5a7fc127f7278be79ef49f9a028358d01)

M  +3    -0    applets/taskmanager/package/contents/ui/Task.qml

https://invent.kde.org/plasma/plasma-desktop/commit/db44453430f6684df06cc1f9c42b3a7eb4b16b86
Comment 30 Nate Graham 2021-05-17 14:45:47 UTC
We've done everything we can on our side; the remaining pieces for fixing this have to be done in Qt. Vlad has helpfully submitted a fix already: https://codereview.qt-project.org/c/qt/qtwayland/+/347783

If and when that is merged into Qt6, we can cherry-pick it into our Qt5 patch collection.
Comment 31 David Redondo 2021-05-18 14:53:45 UTC
Reopening since I had to revert our workaround
Comment 32 David Redondo 2021-06-28 12:04:56 UTC
Git commit 498645ae60da4304512e72884fe2d0401073a628 by David Redondo.
Committed on 28/06/2021 at 12:04.
Pushed by davidre into branch 'master'.

Hide tooltip before opening contextMenu

The tooltip hiding after the context menu is opened, will hide the
context menu.
See d24ab7b5a7fc127f7278be79ef49f9a028358d01 for detailed explanation.
FIXED-IN:5.23

M  +1    -0    applets/taskmanager/package/contents/ui/Task.qml

https://invent.kde.org/plasma/plasma-desktop/commit/498645ae60da4304512e72884fe2d0401073a628
Comment 33 Nate Graham 2021-07-03 01:42:46 UTC
Is there anything left to do here?
Comment 34 David Redondo 2021-07-05 06:47:24 UTC
We have now a workaround for the underlying issue
Comment 35 Nate Graham 2021-07-05 23:53:28 UTC
Does that mean that no user will ever see the problem again?
Comment 36 David Redondo 2021-07-06 06:53:33 UTC
For this specific instance I hope so but there could be other places in plasma where we have this interaction between a tooltip and contextmenu but that would be another bug
Comment 37 Patrick Silva 2021-07-09 13:50:46 UTC
This bug persists with systray icons on neon unstable (duplicate bug 416869).
Comment 38 Nate Graham 2021-09-09 17:05:54 UTC
*** Bug 441941 has been marked as a duplicate of this bug. ***