Skip to content
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

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

Closed
mxmilkiib opened this issue Aug 2, 2023 · 9 comments
Closed

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

mxmilkiib opened this issue Aug 2, 2023 · 9 comments

Comments

@mxmilkiib
Copy link

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

@redtide
Copy link
Collaborator

redtide commented Aug 2, 2023

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
Copy link
Collaborator

redtide commented Aug 6, 2023

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
// 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
Copy link
Collaborator

redtide commented Aug 14, 2023

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 redtide closed this as completed Aug 14, 2023
@redtide redtide removed the new feature Feature additions and requests label Jan 11, 2024
@redtide
Copy link
Collaborator

redtide commented Jan 11, 2024

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

@redtide redtide changed the title Volume change on mousewheel down/up on tray icon? Volume change on mousewheel down/up on tray icon Jan 11, 2024
@redtide redtide reopened this Jan 11, 2024
@redtide
Copy link
Collaborator

redtide commented Mar 18, 2024

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

@redtide redtide closed this as completed Mar 18, 2024
@mxmilkiib
Copy link
Author

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

@redtide
Copy link
Collaborator

redtide commented Mar 18, 2024

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
Copy link
Author

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

@redtide
Copy link
Collaborator

redtide commented Mar 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants