qtilities / voltrayke

Audio volume system tray widget
https://qtilities.github.io/
GNU General Public License v2.0
2 stars 3 forks source link

Volume change on mousewheel down/up on tray icon #3

Closed mxmilkiib closed 6 months ago

mxmilkiib commented 1 year ago

Just a feeler issue in case voltrayke might see development again.

redtide commented 1 year ago

hello! I'm updating some apps in this organization these days, I plan to do it also for this one. I guess I'll have to add also a tooltip for the value while moving the wheel when the widget is hidden.

redtide commented 1 year ago

Self reminder (or for someone else having any idea): just tried but I don't get it to work. In the documentation they say:

Only on X11, when a tooltip is requested, the QSystemTrayIcon receives a QHelpEvent of type QEvent::ToolTip. Additionally, the QSystemTrayIcon receives wheel events of type QEvent::Wheel. These are not supported on any other platform.

Looking at the Qt5 code it should work using installEventFilter() and check for the event type but it seems it doesn't work for the ToolTip type either.

Click here to view code ```cpp // src/application.cpp trayIcon_->installEventFilter(this); // ... bool Qtilities::Application::eventFilter(QObject *, QEvent *event) { // it comes here only for the deferred deletion if (event->type() == QEvent::ToolTip) { // or QEvent::Wheel // ... } return true; } ```
redtide commented 1 year ago

Should be fixed in b5e9574.

The issue I had was that lxqt-panel seems not to handle wheel events for systray, this works with tint2, I suppose also with other panel apps.

EDIT2: as pointed out here, mouse wheel handling in Qt is supported only for the old XEmbed, not the newer StatusNotifierItem specification (used at least in KDE and LXQt):

All window managers and independent tray implementations for X11 that implement the freedesktop.org XEmbed system tray specification.

Please let me know if it's Ok or if you find some other issues, I would like to make a release at some point.

redtide commented 8 months ago

A StatusNotifierItem library is on the way. Might be useful to support both protocols with a XEmbed to SNI proxy (like this?).

redtide commented 6 months ago

Fixed in 587cb92 by replacing QSystemTrayIcon with the new SNI library, XEmbed protocol can't be supported, too obsolete.

mxmilkiib commented 6 months ago

Thank you v much! Luckily I'm looking at move from AwesomeWM to Hyprland shorly, which I guess has SNI!

redtide commented 6 months ago

It seems they are still on XEmbed, which is X11, so it's XWayland?

Edit: I confused the two, can't see what type of bar/dock HL uses, I'll ask to someone that uses it.

Edit2: looks like it have no bar IIUC what Arch Wiki say, so you can try one that have it, Waybar (the most used, I have it but i don't like it like I don't like most of them) seems using libappindicator, the one used by Gnome that now I heard has removed tray icon support.

swfbar seems the one you need.

mxmilkiib commented 6 months ago

Thank you for doing some of the research I needed to do :)

redtide commented 6 months ago

YW, I was curious to know a bit the general situation. I know there is a new protocol on the way but it seems stuck, meanwhile applications implements what it's available.