Bug 359790 - Cannot change system tray icon's context menu items of an app built with Qt 5.5.1
Summary: Cannot change system tray icon's context menu items of an app built with Qt 5...
Status: RESOLVED WORKSFORME
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: qt (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR major
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-25 12:54 UTC by lpugoy
Modified: 2022-11-19 05:14 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lpugoy 2016-02-25 12:54:07 UTC
I have an app that needs to be able to update the context menu items of its system tray icon. We are using Qt 5.5.1 and we include the Qt libs with the app when we package it so we can't use the system libs. This works in other desktop environments but in KDE the context menu items cannot be changed. It happens in Kubuntu 12.04 until 15.10 and probably in other distributions as well (was able to confirm it on Debian too).

Reproducible: Always

Steps to Reproduce:
1. Download Qt's official binary installer from https://download.qt.io/archive/qt/5.5/5.5.1/.
2. Install required packages for Qt Creator. In Kubuntu 12.04 these are g++, libgl1-mesa-dev, and libglu1-mesa-dev.
3. Download Qt project that contains minimal code to reproduce issue here: https://goo.gl/GZxO6q.
4. Open Qt Creator: <Qt installation path>/Tools/QtCreator/bin/qtcreator.
5. Open and run project.
6. Right click on tray icon and click on the "On" entry. It should change to "Off" when the context menu is reopened.

Alternative way:
1. Download the executable with Qt libraries here: https://goo.gl/FYLhIo.
2. export LD_LIBRARY_PATH=/path/to/extracted/folder
3. cd /path/to/extracted/folder
4 ./systray
5. Right click on tray icon and click on the "On" entry. It should change to "Off" when the context menu is reopened.

Actual Results:  
Reopening the tray icon's context menu still shows the "On" entry, it was not replaced with "Off".

Expected Results:  
It should show "Off" instead, and clicking it should show "On".

In the Qt project's tray.cpp file, setContextMenu() is called again after the context menu was updated with new items. This is probably a bug in Qt 5.5.1 since the context menu does not show the new items unless setContextMenu() is called again. This happens on all desktop environments.
Comment 1 Justin Zobel 2022-10-20 23:54:31 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Comment 2 Bug Janitor Service 2022-11-04 05:07:14 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Bug Janitor Service 2022-11-19 05:14:41 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!