Erroneous "No system tray detected" received

Bug #1453303 reported by Twisted Lucidity
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned

Bug Description

System: Kubuntu 15.04 64bit

Actions:
1. Install hplip based on instructions from hplip site.
2. Log out or reboot.
3. Log in.

Result:
1. The error "No system tray detected on this system" is received.
2. hplip can clearly be seen in the system tray and is responsive.
3. Clicking "Ok" causes the working hlpip to exit.

Expected:
1. hplip to not error when system tray is available.

Other observations
1. Manually running "hp-system -x" works without issue.
2. "sni-qt" is installed.

Revision history for this message
Twisted Lucidity (lucidlytwisted) wrote :

Workaround:
Open "/etc/xdg/autostart/hp-systray.desktop" in a text editor.
Change line 7 from:
    Exec=hp-systray -x
to:
    Exec=sleep 15 && hp-systray -x

You may need to adjust the amount of sleep time depending on the speed of your PC.
This means that hp-systray will not actually start until well after the system tray is available, thus avoiding whatever bug is causing the problem.

Revision history for this message
Ian Bruntlett (ian-bruntlett) wrote :

I am experiencing this problem on Ubuntu 20.04.1 LTS on a lenovo ThinkPad T420.

The above solution does work, however, I have two suggestions.

Now my Python is *really* rusty (no pun intended). And my Qt isn't Cute.

The systray detecting code is in this Python file - /usr/share/hplip/ui5/systemtray.py

At the bottom of that file, there is a method called "run". It polls QSystemTrayIcon.isSystemTrayAvailable(), once a second, for 60 seconds. This hardcodes a magic number (60) in the source code. I believe that is an error and it should be possible to override that with a shell variable (if that is practical).

Once the script has determined there is no system tray, it displays a dialogue box stating "No system tray detected on this system." and then waits for the user to "OK" to quit. I think a more robust approach to this would be to have a "Retry" button in this dialogue, so that if a system tray is not detected in time, the user would be able to click "Retry" and hopefully the system tray will be detected that time.

Compliments of the Season...

Revision history for this message
Ian Bruntlett (ian-bruntlett) wrote :

OK..I changed the constant 60 to 600, giving HPLIP a full 10 minutes to get access to the system tray. It still failed to get it.

OTOH, while I was waiting for the above 10 minute wait for a system tray, I discovered that there were *three* instances of systemtray.py running!

$ pgrep -a systr
1795 /usr/bin/python3 /usr/bin/hp-systray -x
1908 /usr/bin/python3 /usr/bin/hp-systray -x
1909 /usr/bin/python3 /usr/bin/hp-systray -x

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.