-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System tray icons applications don't recieve wheel (probably also tooltip) events #1925
Comments
I always assumed that ineffectiveness of wheel scrolling over Audacious's tray icon was a bug in Audacious. But it may be related to this report.
Tooltips are OK here — I say this as a user, not remembering the code and not having time to reread it for now. |
Tooltips are displayed but I meant that are not captured in eventFilter as events, though IDK how they are supposed to be used.
|
The doc talks about two protocols: X11 XEmbed (legacy/obsolete), and the DBus-based tray icons. I think by "Only on X11" it means the obsolete one, which it still supports. Just now, I logged into KDE and saw that Audacious's tray didn't respond to wheel scrolling either. So, this may not be a bug on our side, exactly because it's limited to the legacy protocol. BTW, it's good to see that Qt doc mentions LXQt alongside KDE and Gnome :) |
I see. Well, it kinda sucks that the only one supporting it is on an old implementation, it's useful having the tray icon responding to mouse wheel. So basically it can work only for panel plugins buttons.
Ok, so I can close this I guess. Would be nice if DBus could support this but I can imagine it may be too much to respond to many, fast wheel events.
Oh, nice! I didn't notice it! |
I see a |
I don't know, but I ask myself, "if it was possible, why didn't KDE implement it?" ;) EDIT: Also, see GNOME's new proposal: lxqt/lxqt#2295. It's getting like a jungle ;) |
or why Qt doesn't support it in QSystemTrayIcon via QDBusInterface? It's new stuff to me, so I have no much of an idea, but if it works via DBus I don't understand how it could be X11 specific. |
It would be nice if you could test your app under KDE too (I guess GNOME doesn't have any tray, and I'm not sure about XFCE's implementation when it comes to Qt). |
No luck today: I installed plasma-desktop package, though I don't like KDE and the app crashes there. I need also to redo the QtC configuration which is too old, the debugger is messed up. |
I understand, but, IMHO, KDE may be needed for testing Qt apps thoroughly. I have a full installation for that reason. |
That's right. |
I'm afraid |
What do you mean by empty? It doesn't returns the x y w and h of it in the screen coordinates as stated in the docs? |
No, it didn't when I wrestled with it years ago; it was useless. Whether things have changed since then, I don't know, but I concluded that there was no way to know the rectangle because it belonged to the tray, not to the app. |
Then it's really a total crap of API. |
I don't agree. With the old protocol, the tray menus were those of the apps, and so, they might be alien. With the "new" one (which isn't new anymore), all menus are native. |
how you call random crashes and a geometry() function that doesn't returns what it should then? |
As for EDIT: Never mind; I tested with FeatherNotes and Qt6, and |
I did:
it doesn't work neither under KDE. I haven't investigate much but it seems that geometry() should return something if those |
@tsujan I started my app from terminal and moving the wheel over it, forgetting for a moment about this issue. I only have it and NM applet active and moving the wheel over the tray (over both) I got some debug messages, so I did a search in lxqt-panel code and found this:
4 when moving the wheel down and 4 up. Could this be useful in any way? |
Maybe. But I have no knowledge of (or don't remember) that code. It seems that it was adapted from KDE. |
I haven't realized that SNI stands for StatusNotifierItem: here the link to the interesting part,
Is this related? (@paulolieuthier work) The LXQt plugin implements SNI Scroll but I'm not sure how these are related and so how eventually use them from a client application; I haven't found yet an example at least how to do it via QDBus. |
You're finding interesting things in those codes! A problem LXQt inherited from KDE, or just something that wasn't possible for some reason? Hopefully @palinek and @paulolieuthier could shed some light on this. EDIT: According to the code comment, it may be the latter: |
yes, that's what I wanted to point out with my "this related" link. Now I just noticed that I have 2 plugins for the tray, one (tray) is for the old xembed based applications and one for the new ones (statusnotifier). Trying to disable one makes vanish one of my QSystemTrayIcon based application (the volume control I did based on volume plugin) while another (a JACK control settings interface I made) is on the statusnotifier. |
What I can say for sure is that a tray icon made by using purely Qt methods doesn't need the obsolete X11 XEmbed protocol and works everywhere. Wayland isn't just a possibility nowadays. |
I have no X11 dependencies in both applications, the volume tray app is basically a standalone version of LXQt panel' volume plugin with additional fixes to make work alsamixer as external mixer application and a linear, normalized volume using ALSA (like other volume controls do like PNMixer). The wheel event works on xembed based panels like tint2, but just by applying an event filter The only difference is that the other one depends to QDBus, but for unrelated reasons: it wraps to a custom dbus service to monitor when the jack application is running and forward its log. I should investigate the qt code to understand the logic. |
Modern system tray bars use the https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/ DBus interface to setup icons. Qt's QSystemTrayIcon does not implement the Scroll event properly. Other applications have the same issue: |
upvoted, I'm still curious to know if this thing is managed somewhere in KDE (but not that much to reinstall plasma :P ). |
It isn't. → #1925 (comment) |
KDE has two system tray icon classes,
The former derives from QSystemTrayIcon and doesn't support wheel events. I suppose the icons that support wheel events are based on KStatusNotifierItem. |
As I said, I just launched Audacious and saw that mouse wheel didn't work with its tray under KDE either.
That's what LXQt does too. |
@tsujan: Is it possible that audacious is using XEmbed? I think this bug could be fixed from LXQt side without caring about what Qt or KDE does if it's based on a protocol on top of DBUS, by catching related messages directly. |
Nope! I'm under Wayland (LXQt+LabWC+Waybar) and there's no difference with Waybar's tray. The results of my test codes were the same too. |
I just discovered QDBUS_DEBUG from here: https://doc.qt.io/qt-5/qtdbus-index.html |
do you mean something like this?
(120 or -120 as values only here, with my own VolTrayke volume control app) |
Yes, exactly. I get +/- 120 as well. |
It seems the 120 are eighths of a degree, so 15 degrees. |
FTR I made a SNI client example simulating a volume control, the only thing I'm not able to make work yet is the volume tooltip when using the wheel (I replaced it with a notification message temporarily). I used the SNI code from Note that current |
@tsujan I think would be nice to have lxqt SNI as library extracted from qt plugin (plugin-statusnotifier seems to have more code though) like it is for kstatusnotifieritem in Arch for KDE. Also it seems that the Meanwhile I sent a mail to Paulo Lieuthier asking some info about it. |
You need the latest Qt6 branches. It works here. For the rest, @palinek is the expert. Frankly, I don't see any problem other than that Qt bug, which isn't our job to fix. |
And we don't use it anymore. See lxqt/lxqt-qtplugin@8e8a2b3 |
There is no problem (except is not clear how to use tooltips in lxqt SNI), it's just that by having a library for SNI, clients can use it to write applications that uses that protocol instead depending by KDE stuff. |
I didn't even know there was a |
@stefonarch and I use the Qt6 branches since they were made (we also use them under Wayland). |
Not following fully LXQt development nor Wayland switch to labwc here yet. |
|
I wonder why DE developers only fork stuff internally instead maintain the original, so now there are a LXQt fork and a bundled one in KDE useless for other people. |
I forgot to mention that IIUC the XEmbed protocol should be supported by |
Agreed. |
As for |
Yes, and those issues are also a reason more to work on a common project instead doing forks anywhere, so a single new @sebholt made me notice that there is no |
Maybe, in an ideal world. But, again, we would have to wait a long time before porting our main libraries to Qt6. IMHO, |
@tsujan FTR: feel free to close this at any time when you will no need to track the QSystemTrayIcon bug, to me this is solved by using our SNI library (should be made public soon-ish), which derives by both LXQt code and KSNI. |
Expected Behavior
A X11 Qt application using QSystemTrayIcon should recieve QEvent::ToolTip and QEvent::Wheel events.
Current Behavior
No events, except deferred delete on an attached eventFilter.
Possible Solution
IDK.
Steps to Reproduce (for bugs)
Debug an application using QSystemTrayIcon that has an eventFilter on it,
it should call it only on deferred delete.
Context
I wrote a standalone application based on lxqt-panel volume plugin that can run alsamixer from QTerminal and use ALSA' normalized/linear volume. Now I want to control the volume by
rotating the mouse wheel over the tray icon like in the original plugin, but this works only under Tint2 system tray, (I haven't tried others).
See qtilities/voltrayke#3.
System Information
The text was updated successfully, but these errors were encountered: