PyQt5 tray icon disappears
Question: Using PyQt5 5.2 and Python 2.7.6 on Arch Linux with XMonad 0.11 and trayer (or
stalonetray).

Wrote up a little demo program:

    
    
    #!/usr/bin/env python2
    
    from PyQt5 import QtGui, QtWidgets
    import signal
    
    signal.signal(signal.SIGINT, signal.SIG_DFL)
    
    app = QtWidgets.QApplication([])
    
    icon = QtGui.QIcon('clock.png')
    tray = QtWidgets.QSystemTrayIcon(icon)
    tray.show()
    
    app.exec_()
    

(clock.png is just some 256x256 icon I found)

If my tray is running, the tray icon shows up fine, though the transparent
background seems to be ignored. If the tray gets restarted, which happens from
time to time as I recompile XMonad or switch monitor setups, the tray icon
disappears and only shows a thin black vertical bar, which I usually can't
interact with. The rest of my usual tray icons (Spotify, Parcellite, nm-
applet, Dropbox) display just fine.


Answer: Qt 5 (at least until current 5.2.1 stable version) is not friend with most
trays under X11. This goes on for quiet some time.

Relevant bug reports:

  * <https://bugreports.qt.io/browse/QTBUG-31762>
  * <https://bugreports.qt.io/browse/QTBUG-35658>

