https://bugs.kde.org/show_bug.cgi?id=383202

Konrad Materka <mate...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mate...@gmail.com

--- Comment #5 from Konrad Materka <mate...@gmail.com> ---
The situation happens only when:
* Qt QPA (plasma-integration) is not used
* Tray icon menu is changed to new menu
* New menu is created before change

This is partially (or mostly) a Qt bug. Qt does not send any event when menu is
replaced by another menu. In Qt 5.11 (and newer) on menu change Qt sends:
> signal time=1571299503.727968 sender=:1.628 -> destination=(null destination) 
> serial=22 path=/StatusNotifierItem; interface=org.kde.StatusNotifierItem; 
> member=NewMenu
"NewMenu" is not supported by the standard, they admit that:
https://github.com/qt/qtbase/commit/ff169e8859457188f94aed86368876ba5bab2e90
In older Qt (for example 5.9 LTS) nothing is being send!

Possible workarounds (for developers):
* do not replace whole menu, update it (even clear if needed
m_tray->contextMenu()->clear()) - good option
* set mew menu, but change anything later (for example, add new action) - good
option
* recreate whole System Tray icon - not so great advice
* use plasma-integration - bad advice, developers have no influence on that

Possible workaround on KDE Plasma side:
* for Qt >= 5.11: implement "NewMenu" signal - but it is not part of the
standard...
* Qt < 5.11: disable cache entirely - not good, breaks global menu and impacts
performance

Possible solution on Qt side:
* send "LayoutUpdated" in addition to "NewMenu" - I will create an issue in Qt
Bug tracker

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to