[Interest] Qt systray icon fails to load, causing X to blink and spam error
Rutledge Shawn
Shawn.Rutledge at digia.com
Fri Mar 28 14:41:48 CET 2014
On 20 Mar 2014, at 11:37 PM, Frank Shin wrote:
> Hi, this is my first post here and it is in regards to a qt5 base app that is a gui for connman internet manager. The author released this software on his github below
> https://github.com/andrew-bibb/cmst
> I am hoping to help the author by asking this forum and hopefully someone can give a lead on where to look.
>
> When running the app ./cmst an error message saying QXcbWindow: Unhandled client message: “_NET_SYSTEM_TRAY_S0”
> Video of this error can be found http://frankshin.com/files/videos/cmst1.mkv
> If I run the app with the “-d” flag which disables the systray icon from showing, the app works fine and displays the Qt window.
>
> The author responded with “That information did help. I don’t know for sure, but I have a theory. For QT the system tray implementation for X11 must be freedesktop.orgcompliant. I’ve looked at the freedesktop specification and they define the following hints: _NET_WM_NAME, WM_CLASS, _NET_WM_ICON, _NET_SYSTEM_TRAY_ORIENTATION.
>
> I then went to suckless.org site to see if they state anywhere that their tray is freedesktop.org compliant. Didn’t find an answer to that one way or the other, but I did look at the code for their system tray and on line 459 found this hint: _NET_SYSTEM_TRAY_S0. My theory is that the system tray may not be strictly freedesktop.org compliant, or perhaps it expands upon the basic compliance and QT can’t handle the expansion.
>
> I have revised the sources to check for a systemtray before we try to access it. I want to temporarily remove the tray from my system so I can test the new pieces. Once I’ve tested it it will be part of the package I’m planning to put out this weekend (actually on github now, but as I said, untested). I’m hoping that will let us work around the problem, but if QT recognizes the suckless.org tray, thereby passing my check, but chokes trying to put an icon there I may have to fall back to another commandline switch that will force the program to not use a systemtray.”
>
> This issue seems to only happen to me as the rest of the users of this app are running a DE. I am running only DWM as my WM and my github for DWM is athttps://github.com/frank604/dwm
> Other systray icons do work for me. Simplescreenrecorder, steam, clipit, dropbox, and caffeine.
When I run cmst on OpenBox with the "trayer" tray, I don't see the icon, but I see it taking up a pixel or so of extra space (the tray expands slightly). Other tray icons work fine with trayer too. The Qt systray example (qtbase/examples/widgets/desktop/systray) works with trayer, and even with awesome, whereas it does not work with dwm. So it seems dwm has a divergent way of doing it. Feel free to write up a bug, for what it's worth; maybe somebody will eventually be able to tell us what is the one true way of getting working tray icons on every WM and DE. ;-) It seems to be the least consistent X "standard" ever. See also https://bugreports.qt-project.org/browse/QTBUG-34364 (and numerous others) Maybe we could alternatively consider it a bug in dwm; maybe compare the code with how awesome does it. The #xcb IRC channel is a good place to ask questions if you are digging into window manager code.
Aside: I wonder why cmst doesn't use Qt bearer management. It's too incomplete, something wrong with it, or the author didn't know about it? I haven't gotten around to trying it myself. When I switched from wicd to connman a couple of months ago on my laptop, I didn't find a Qt client, so have still been using the gtk one for now. But IMO it would be even better to make a nice QML interface to connman (via bearer management to the extent possible?) so that the whole UI can be built in Qt Quick. But that sounds like the kind of project that KDE will need to do at some point… so maybe somebody already started.
More information about the Interest
mailing list