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

StatusIcon is not displayed in GNOME + Wayland #1606

Open
xinyazhang opened this issue Jul 4, 2016 · 25 comments
Open

StatusIcon is not displayed in GNOME + Wayland #1606

xinyazhang opened this issue Jul 4, 2016 · 25 comments

Comments

@xinyazhang
Copy link
Contributor

Version: 0.7.2-2
Environment: Fedora 24, Wayland
Procedure to reproduce: enable 'Close minimizes to tray' and click the close button, deadbeef player simple disappears.

Possible reason:
I took a look at the minimization (or iconify) code. It calls gtk_widget_hide when minimizing to tray is enable. However the Gtk APIs designed for this function are

void
gtk_window_iconify (GtkWindow *window);

and

void
gtk_window_deiconify (GtkWindow *window);
@xinyazhang
Copy link
Contributor Author

By the way, the tray icon never shows up ("Hide system tray icon" is enabled). However, thunderbird shows the icon correctly.

I'm looking into this issue.

@xinyazhang
Copy link
Contributor Author

xinyazhang commented Jul 4, 2016

Apparently this is a Wayland-specific issue. Under X11 works without problems.
Since Wayland isn't default, it's very likely to be a gnome's bug.

@Oleksiy-Yakovenko
Copy link
Member

I took a look at the minimization (or iconify) code. It calls gtk_widget_hide when minimizing to tray is enable. However the Gtk APIs designed for this function are

It's because when an app "minimizes" to sys tray -- it doesn't really minimize or iconify.

I don't know much about wayland and how its system tray implementation works..

Basically, your problem is not what you wrote.. it's that there's no tray icon at all.

The old GTK status icon API is deprecated, so relatively recently deadbeef got a new plugin https://github.com/Alexey-Yakovenko/deadbeef/tree/master/plugins/statusnotifier

This is only available on master branch, so this may explain why it doesn't work if you're using 0.7.2

@xinyazhang
Copy link
Contributor Author

Thanks for you reply.

After some research I found the real problem is Wayland has removed system tray completely (Gnome leaves the tray exclusively for X11 apps).

It seems the proposed solutions by DEs (at least Gnome) is to support MPRIS2 Quickly Access Media Controls, and at least Rhythmbox is working in this way. Thus shall we change this issue as "Mainline MPRIS2 plugin"?

Thank you.

@Oleksiy-Yakovenko
Copy link
Member

They are 2 different things.

There's still notification area in KDE5, GNOME3, etc, and it works in deadbeef with the new plugin that I mentioned.

Then there's the Ubuntu sound menu, and similar in other desktops, which are not supported by Deadbeef natively, but there are multiple third party plugins and scripts, which have been available for quite a while.

I'm not convinced to support MPRIS stuff as part of my tree yet, but feel free to post a feature request about it.

@xinyazhang
Copy link
Contributor Author

I totally agree. They are really two different things, but the problem is, from my testing the KDE plugin doesn't work under Gnome 3, while the third-party mpris2 plugin has no problem in presenting status in Gnome.

statusnotify without mpris2

mpris2 with statusnotify disabled

After taking a look at the statusnotify code, it seems this plugin employs KDE specific D-Bus interfaces ("org.kde.StatusNotifierItem"), and there isn't corresponding interface in Gnome 3 yet.

@Oleksiy-Yakovenko
Copy link
Member

@xinyazhang I just tried in GNOME3 which ships in Ubuntu 16.04, and the standard GtkStatusIcon works just fine. It appears in the bottom left corner, like this:

image

@Oleksiy-Yakovenko
Copy link
Member

@xinyazhang

I can't find any information, whether this notification area is still present in wayland version of GNOME shell, or what kind of protocol it's using.

@Oleksiy-Yakovenko
Copy link
Member

@ugilio Hey mate, hope it's all right that I'm summoning you.

I tried to figure out why the statusnotifier plugin doesn't work in Ubuntu (Unity)...

Can't find any reason for that. I tried adding more properties to XML, like this:

        "    <property type='s' name='IconThemePath' access='read'/>"
        "    <property type='o' name='Menu' access='read'/>"
        "    <property type='b' name='ItemIsMenu' access='read'/>"

and handling them like this (hack-ish):

    else if (g_strcmp0(property_name, "IconThemePath") == 0)
        ret = g_variant_new_string("/usr/share/icons/hicolor");
    else if (g_strcmp0(property_name, "Menu") == 0)
        ret = g_variant_new_object_path ("/org/deadbeef/StatusNotifier/Menu");
    else if (g_strcmp0(property_name, "ItemIsMenu") == 0)
        ret = g_variant_new_boolean(FALSE);

Still couldn't get it to work.

Can you give me a pointer how to debug this stuff? Are there any tools to monitor what's going and where it fails?

@Oleksiy-Yakovenko
Copy link
Member

@ugilio I found this in dbus-monitor output:

method call time=1467720327.895196 sender=:1.33 -> destination=org.freedesktop.DBus serial=178 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=StartServiceByName
   string "org.kde.StatusNotifierItem-23958-1"
   uint32 0
error time=1467720327.895237 sender=org.freedesktop.DBus -> destination=:1.33 error_name=org.freedesktop.DBus.Error.ServiceUnknown reply_serial=178
   string "The name org.kde.StatusNotifierItem-23958-1 was not provided by any .service files"

does this mean that Unity doesn't support this protocol at all, or is it something wrong on Deadbeef's side?

@Oleksiy-Yakovenko
Copy link
Member

more info...

$ tail -f ~/.cache/upstart/indicator-application.log

(process:1781): indicator-application-service-WARNING **: Notification Item on object /StatusNotifierItem of org.kde.StatusNotifierItem-29924-1 doesn't have enough properties.

apparently, I'm still missing some required properties

@Oleksiy-Yakovenko
Copy link
Member

Ahh.. I'm wrong, this message disappears when I add the IconThemePath, Menu and ItemIsMenu.

So I'm on the right way, but still not quite there..
Probably need to actually have some sort of Menu object initialized, but didn't figure out how to do this yet.

@Oleksiy-Yakovenko
Copy link
Member

Oleksiy-Yakovenko commented Jul 5, 2016

@xinyazhang btw, could you please try if this plugin works with wayland?

https://github.com/vovochka404/deadbeef-statusnotifier-plugin

It uses the same protocol as the built-in status notifier, but seems to be more complete, and works in Ubuntu/Unity at least.

I suppose it should work in GNOME too.

@Oleksiy-Yakovenko
Copy link
Member

I tracked it down to the Menu property.. it needs to be a valid GObject path, with an associated DBUS service, which serves the menu, and this could be implemented with the library called "dbusmenu-glib", which is quite a bad dependency to bring.

@Oleksiy-Yakovenko
Copy link
Member

I suppose we can repurpose this issue for tracking Unity progress with statusnotifier plugin...

@Oleksiy-Yakovenko Oleksiy-Yakovenko changed the title Iconify doesn't work Statusnotifier plugin doesn't work in Ubuntu/Unity Jul 5, 2016
@Oleksiy-Yakovenko Oleksiy-Yakovenko changed the title Statusnotifier plugin doesn't work in Ubuntu/Unity Statusnotifier plugin doesn't work in Ubuntu/Unity, and possibly the same reason breaks it on GNOME+Wayland Jul 5, 2016
@xinyazhang
Copy link
Contributor Author

@Alexey-Yakovenko
I believe Gnome has removed system tray icon support for all Wayland Applications, and there is also a bug report for Lantern for this problem. This design has been proposed long time ago, but it looks they tried to keep the tray icon working for all X11 applications, for the sake of compatibility, and drop the support for Wayland applications from the beginning.

@Oleksiy-Yakovenko
Copy link
Member

@xinyazhang so there's no system tray at all in GNOME shell on wayland?

Can anyone of people who has access to a system running wayland + GNOME confirm?

@Oleksiy-Yakovenko
Copy link
Member

@xinyazhang it looks like you are correct about it, I'm updating the issue title to reflect this.

Your bug report doesn't make sense anymore, because if GNOME ditched the status icon support completely -- then nothing can be done on application side.

MPRIS plugin can be used, if needed, and Deadbeef seems to be satisfying all of the guidelines, even with default settings.

@Oleksiy-Yakovenko Oleksiy-Yakovenko changed the title Statusnotifier plugin doesn't work in Ubuntu/Unity, and possibly the same reason breaks it on GNOME+Wayland Statusnotifier plugin doesn't work in Ubuntu/Unity Jul 5, 2016
@xinyazhang
Copy link
Contributor Author

No, I tried vovochka404's plugin, but the status icon still doesn't present.

@Oleksiy-Yakovenko
Copy link
Member

I feel like stealing this thread for an unrelated issue (Unity appindicator) was wrong.
Will make a new issue, and close this.

@Oleksiy-Yakovenko Oleksiy-Yakovenko changed the title Statusnotifier plugin doesn't work in Ubuntu/Unity StatusIcon is not displayed in GNOME + Wayland Jul 5, 2016
@xinyazhang
Copy link
Contributor Author

xinyazhang commented Jul 5, 2016

@Alexey-Yakovenko
The actual problem is, we need some method similar with "minimizing to tray" to let deadbeef run in background. If both mpris2 and status icon failed to present (that's the case of the git master without 3rd party plugins), after "minimizing" the main UI will simply disappear and there is no way to get it back besides running it again.

@Oleksiy-Yakovenko
Copy link
Member

Oleksiy-Yakovenko commented Jul 5, 2016

@xinyazhang

The actual problem is, we need some method similar with "minimizing to tray" to let deadbeef run in background.

No, we don't. There's no tray in GNOME. Deadbeef can still run "in background" by hiding the main window, but this will remain disabled by default.

Then, the GNOME guidelines explicitly say that apps should NOT do that:

Applications can run without a window under GNOME 3. However, they are only recommended to do so when:
The application does not play sound or music.

@xinyazhang
Copy link
Contributor Author

@Alexey-Yakovenko
Got it, thank you.

@sljunkie
Copy link

sljunkie commented Feb 2, 2017

I think GNOME + Wayland ignores the system tray completely; it's deprecated according to GNOME dev's.

On the other hand, the mpris2 plugin works wonders with deadbeef + GNOME 3 since media players that support it are fully integrated in the notification area (see screenshot). Perhaps deadbeef could include this plugin by default.

screenshot from 2017-02-02 05-05-30

@AlexanderZhirov
Copy link

Unfortunately, the icon does not appear in the system tray of the Budgie desktop environment.

2024-02-04_00-28

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

No branches or pull requests

4 participants