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

xpra doesn't have a tray icon under Wayland with KWin #3789

Closed
allo- opened this issue Mar 8, 2023 · 26 comments
Closed

xpra doesn't have a tray icon under Wayland with KWin #3789

allo- opened this issue Mar 8, 2023 · 26 comments
Labels

Comments

@allo-
Copy link

allo- commented Mar 8, 2023

Describe the bug
xpra does not show its tray icon in a KDE Wayland session

To Reproduce
Steps to reproduce the behavior:

  1. Run a KDE Wayland session
  2. Connect from a terminal to an xpra server

Expected
A tray icon with the functions that are provided when using X11 (Launch applications, enable/disable features like forwarding clipboard, sound, etc.)

Actual Behavior
No tray icon is visible.

System Information (please complete the following information):

  • Server OS: Debian stable
  • Client OS: Debian testing
  • Xpra Server Version: 4.4.3-r0-1
  • Xpra Client Version: 5.0-r32793-1
@allo- allo- added the bug Something isn't working label Mar 8, 2023
@totaam
Copy link
Collaborator

totaam commented Mar 9, 2023

Tagging as part of the endless Linux Desktop series "The endless and unnecessary breakage of basic desktop functionality continues".
Some details in #2161 and #1016 (comment), #2161 (comment), #406

Do you have these packages installed: gir1.2-appindicator3-0.1 | gir1.2-ayatanaappindicator3 ?
And also: gnome-shell-extension-top-icons-plus gnome-shell-extension-appindicator ?

@allo-
Copy link
Author

allo- commented Mar 9, 2023

gir1.2-ayatanaappindicator3-0.1, libappindicator1 and libayatana-appindicator3-1 are installed.

I hope I don't need gnome shell extensions for a KDE session as they would probably install almost all of gnome as dependencies.

@totaam
Copy link
Collaborator

totaam commented Mar 9, 2023

I hope I don't need gnome shell extensions for a KDE session as they would probably install almost all of gnome as dependencies.

And this exactly why we don't install them as Recommended dependencies: #2979 (comment)

@allo-
Copy link
Author

allo- commented Mar 9, 2023

And this exactly why we don't install them as Recommended dependencies: #2979 (comment)

So am I right that I do not need gnome-shell packages?
Or is this another thing where things are mixed together which should be separated?

@totaam
Copy link
Collaborator

totaam commented Mar 9, 2023

@allo- I have no idea which package you may need to make it work under KDE, sorry.

@totaam
Copy link
Collaborator

totaam commented Mar 16, 2023

If you find out which packages are needed to make the system tray work under KDE, let us know!

@totaam totaam closed this as not planned Won't fix, can't repro, duplicate, stale Mar 16, 2023
@allo-
Copy link
Author

allo- commented Mar 16, 2023

I wonder why you're closing this. My KDE Wayland session has no problems with the trayicons of most programs, but xpra silently does not show any. So I would suppose this is a xpra bug or at least something xpra should have a workaround for if it is some chaos with new Wayland libraries, gnome specific implementations and so on.

I wouldn't think there is a package for KDE missing, or at least I would not know what additional package should be needed. It is quite possible that KDE still have bugs as well (and KDE Wayland is not my primary session), but I do not see an obvious indication of that either.

So what do you suppose to be a missing package? Some libindicator(?) to Wayland middleware? Or would it need a new python trayicon library and you don't know yet which? I would suppose, that it should "just work" and if it does not it is a bug somewhere.

I see that Wayland may not be high-priority, but I am not sure if this should be closed and probably one should test other Wayland desktops as well when it is desktop specific.

@totaam totaam reopened this Mar 16, 2023
@totaam
Copy link
Collaborator

totaam commented Mar 16, 2023

Please post the client's output when running with -d tray.
Then maybe we can figure out which backend it is using and perhaps there is a better one we should be using on your particular DE flavor.

@allo-
Copy link
Author

allo- commented Mar 16, 2023

Will do later. I am also willing to do more detailed tests for experimental patches and so on.

@totaam
Copy link
Collaborator

totaam commented Mar 16, 2023

See also #3342, #476 and #406

@allo-
Copy link
Author

allo- commented Mar 16, 2023

2023-03-16 18:44:50,674 set_icon(None) using filename='/usr/share/xpra/icons/xpra.png'
2023-03-16 18:44:50,674 set_icon_from_file(/usr/share/xpra/icons/xpra.png) tray_widget=<Gtk.StatusIcon object at 0x7eff71cbc340 (GtkStatusIcon at 0x272f7a0)>
2023-03-16 18:44:50,675 may_guess() GUESS_GEOMETRY=False, current guess=None
2023-03-16 18:44:50,675 GTKStatusIconTray.get_geometry() no geometry value available, returning guess: None
2023-03-16 18:44:50,675 bogus tray icon size: 0x0
2023-03-16 18:44:50,675 may_guess() GUESS_GEOMETRY=False, current guess=None
2023-03-16 18:44:50,675 GTKStatusIconTray.get_geometry() no geometry value available, returning guess: None
2023-03-16 18:44:50,675 set_icon_from_pixbuf(<GdkPixbuf.Pixbuf object at 0x7eff70942a00 (GdkPixbuf at 0x20f8120)>) geometry=(0, 0, 0, 0), icon size=(48, 48)

(python3:3973): Gtk-CRITICAL **: 18:44:50.675: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
2023-03-16 18:44:50,973 enabled remote logging
2023-03-16 18:44:50,973 Xpra X11 seamless server version 4.4
2023-03-16 18:44:50,976 Attached to xpra server at server:22
2023-03-16 18:44:50,976  (press Control-C to detach)

2023-03-16 18:44:50,976 get_tray_title()='ssh://user@server/10' (items=('ssh://user@server/10',))
2023-03-16 18:44:50,982 get_tray_title()='ssh://user@server/10' (items=('ssh://user@server/10',))
2023-03-16 18:44:51,057 running, 3 windows
2023-03-16 18:44:51,061 set_tray_icon() DYNAMIC_TRAY_ICON=True, tray=Tray(0:Xpra)
2023-03-16 18:44:51,061 set_tray_icon() 3 windows, 3 icons, 2 missing
2023-03-16 18:44:51,061 set_tray_icon() using default icon
2023-03-16 18:44:51,061 set_icon(None) using filename='/usr/share/xpra/icons/xpra.png'
2023-03-16 18:44:51,061 set_icon_from_file(/usr/share/xpra/icons/xpra.png) tray_widget=<Gtk.StatusIcon object at 0x7eff71cbc340 (GtkStatusIcon at 0x272f7a0)>
2023-03-16 18:44:51,062 may_guess() GUESS_GEOMETRY=False, current guess=None
2023-03-16 18:44:51,062 GTKStatusIconTray.get_geometry() no geometry value available, returning guess: None
2023-03-16 18:44:51,062 bogus tray icon size: 0x0
2023-03-16 18:44:51,062 may_guess() GUESS_GEOMETRY=False, current guess=None
2023-03-16 18:44:51,062 GTKStatusIconTray.get_geometry() no geometry value available, returning guess: None
2023-03-16 18:44:51,062 set_icon_from_pixbuf(<GdkPixbuf.Pixbuf object at 0x7eff70989800 (GdkPixbuf at 0x207dd80)>) geometry=(0, 0, 0, 0), icon size=(48, 48)

(Xpra:3973): Gtk-CRITICAL **: 18:44:51.062: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
2023-03-16 18:44:51,062 set_tray_icon() DYNAMIC_TRAY_ICON=True, tray=Tray(0:Xpra)
2023-03-16 18:44:51,062 set_tray_icon() 3 windows, 3 icons, 1 missing
2023-03-16 18:44:51,062 set_tray_icon() using default icon
2023-03-16 18:44:51,063 set_icon(None) using filename='/usr/share/xpra/icons/xpra.png'
2023-03-16 18:44:51,063 set_icon_from_file(/usr/share/xpra/icons/xpra.png) tray_widget=<Gtk.StatusIcon object at 0x7eff71cbc340 (GtkStatusIcon at 0x272f7a0)>
2023-03-16 18:44:51,063 may_guess() GUESS_GEOMETRY=False, current guess=None
2023-03-16 18:44:51,063 GTKStatusIconTray.get_geometry() no geometry value available, returning guess: None
2023-03-16 18:44:51,063 bogus tray icon size: 0x0
2023-03-16 18:44:51,063 may_guess() GUESS_GEOMETRY=False, current guess=None
2023-03-16 18:44:51,063 GTKStatusIconTray.get_geometry() no geometry value available, returning guess: None
2023-03-16 18:44:51,063 set_icon_from_pixbuf(<GdkPixbuf.Pixbuf object at 0x7eff7097d3c0 (GdkPixbuf at 0x207dde0)>) geometry=(0, 0, 0, 0), icon size=(48, 48)

(Xpra:3973): Gtk-CRITICAL **: 18:44:51.063: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
2023-03-16 18:44:51,064 set_tray_icon() DYNAMIC_TRAY_ICON=True, tray=Tray(0:Xpra)
2023-03-16 18:44:51,064 set_tray_icon() 3 windows, 3 icons, 0 missing
2023-03-16 18:44:51,064 set_tray_icon() using default icon
2023-03-16 18:44:51,065 set_icon(None) using filename='/usr/share/xpra/icons/xpra.png'
2023-03-16 18:44:51,065 set_icon_from_file(/usr/share/xpra/icons/xpra.png) tray_widget=<Gtk.StatusIcon object at 0x7eff71cbc340 (GtkStatusIcon at 0x272f7a0)>
2023-03-16 18:44:51,065 may_guess() GUESS_GEOMETRY=False, current guess=None
2023-03-16 18:44:51,065 GTKStatusIconTray.get_geometry() no geometry value available, returning guess: None
2023-03-16 18:44:51,065 bogus tray icon size: 0x0
2023-03-16 18:44:51,065 may_guess() GUESS_GEOMETRY=False, current guess=None
2023-03-16 18:44:51,065 GTKStatusIconTray.get_geometry() no geometry value available, returning guess: None
2023-03-16 18:44:51,065 set_icon_from_pixbuf(<GdkPixbuf.Pixbuf object at 0x7eff7097fcc0 (GdkPixbuf at 0x207dd80)>) geometry=(0, 0, 0, 0), icon size=(48, 48)

(Xpra:3973): Gtk-CRITICAL **: 18:44:51.065: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed

@totaam
Copy link
Collaborator

totaam commented Mar 17, 2023

Your log sample is incomplete and is missing the crucial part:

def get_native_tray_classes():
#could restrict to only DEs that have a broken system tray like "GNOME Shell"?
c = []
if USE_NATIVE_TRAY:
try:
from xpra.platform.xposix.appindicator_tray import AppindicatorTray
c.append(AppindicatorTray)
except (ImportError, ValueError):
traylog("cannot load appindicator tray", exc_info=True)
traylog.warn("Warning: appindicator library not found")
traylog.warn(" you may want to install libappindicator")
traylog.warn(" to enable the system tray.")
if get_saved_env_var("XDG_CURRENT_DESKTOP", "").upper().find("GNOME")>=0:
traylog.warn(" With gnome-shell, you may also need some extensions:")
traylog.warn(" 'top icons plus' and / or 'appindicator'")
traylog("get_native_tray_classes()=%s (USE_NATIVE_TRAY=%s)", c, USE_NATIVE_TRAY)
return c

This would have shown us why you end up with the GTKStatusIconTray rather than the AppindicatorTray.

To figure it out, you could also just run this file from a command line:

python3 /usr/lib/*/*/xpra/platform/xposix/appindicator_tray.py

@allo-
Copy link
Author

allo- commented Mar 17, 2023

python3 /usr/lib///xpra/platform/xposix/appindicator_tray.py

Tested under X11 (will test Wayland later) and there seems to be something missing:

$ python3 /usr/lib/*/*/xpra/platform/xposix/appindicator_tray.py
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xpra/platform/xposix/appindicator_tray.py", line 26, in <module>
    gi.require_version('AppIndicator3', '0.1')
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 126, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace AppIndicator3 not available

Looks like I may have to test different libindicator packages. gir1.2-ayatanaappindicator-0.1 is not installed but looks like it may be the right one because of the version, but it would uninstall libappindicator1. A seemingly outdated recommendation is gir1.2-appindicator3-0.1 what doesn't exist in current Debian testing.

@totaam
Copy link
Collaborator

totaam commented Mar 17, 2023

This was changed 6 months ago: 45ba9b2, we recommend one or the other:

,gir1.2-appindicator3-0.1 | gir1.2-ayatanaappindicator3

I've changed it again to recommend both packages, so you should end up with one that works - no matter what distribution / version you have.
I have no idea why the new packages doesn't provide the old name. Answer on a postcard.

@allo-
Copy link
Author

allo- commented Mar 17, 2023

E: Package 'gir1.2-ayatanaappindicator3' has no installation candidate

and

gir1.2-ayatanaappindicator3-0.1 is already the newest version (0.5.92-1).

but for gir1.2-ayatanaappindicator-0.1

The following additional packages will be installed:
  gir1.2-gtk-2.0 libayatana-appindicator1 libayatana-indicator7
The following packages will be REMOVED:
  libappindicator1
The following NEW packages will be installed:
  gir1.2-ayatanaappindicator-0.1 gir1.2-gtk-2.0 libayatana-appindicator1 libayatana-indicator7

@totaam
Copy link
Collaborator

totaam commented Mar 17, 2023

gir1.2-ayatanaappindicator-0.1 is the GTK2 version - we don't need that.

But of course, Debian uses two version numbers as part of the package name. Because reasons.
Although the debian package search does manage to find gir1.2-ayatanaappindicator3 without problems..


@allo- more importantly: does this make any difference, is xpra choosing the appindicator backend now?
If not, what does the log file say?

@allo-
Copy link
Author

allo- commented Mar 17, 2023

I will test Wayland later. Currently the plasma wayland session is having its own problems with massive lag for the input devices, I do not know if some Wayland libraries or the plasma/kwin update in the meantime are the problem. Sometimes I think the whole xorg/freedesktop stuff is causing massive headaches.

Yesterday I still tested the tray issue on a massive laggy session because I promised to provide the log (and probably the log got cut off because I had to pipe it into a log file and kill the session afterward). I think I can test later when I have time where I do not need a working desktop at the same time.

totaam added a commit that referenced this issue Mar 17, 2023
because of course they did
@totaam
Copy link
Collaborator

totaam commented Mar 17, 2023

You also need the commit above (because they've changed the name of the bindings.. for reasons) and then you also need to enable appindicator in gnome-tweaks:
fix-gnome-tray

They sure know how to make it hard for applications to integrate into the desktop.
And the end result is still "meh": appindicator is limited to ugly menus so this is nowhere near as user-friendly as the tray menu we have on all the other platforms. Better than nothing I guess?

@totaam totaam closed this as completed Mar 17, 2023
@allo-
Copy link
Author

allo- commented Mar 17, 2023

Thank you, it works now. It at least shows the tray icon, with the currently unusable input I didn't try the menu but I don't see why it shouldn't work. Gladly I did not need to use gnome-tweaks for KDE. The X11 session now also seems to use AppIndicator instead of Gtk Trayicons.

@allo-
Copy link
Author

allo- commented Mar 17, 2023

I have a strange side-effect: The menu item "clipboard" now does not have a submenu.

I thought it would be an independent issue, but when I change AyatanaAppIndicator3 to an invalid string again, the menu is there.

@totaam
Copy link
Collaborator

totaam commented Mar 26, 2023

but when I change AyatanaAppIndicator3 to an invalid string again, the menu is there.

I saw this behaviour once, but now the clipboard menu is shown every single time - looks like a fluke.
I think we can close the other ticket: #3800

totaam added a commit that referenced this issue May 25, 2023
@totaam
Copy link
Collaborator

totaam commented May 25, 2023

This caused a regression, fixed in 9613d1f

totaam added a commit that referenced this issue May 25, 2023
totaam added a commit that referenced this issue May 25, 2023
@allo-
Copy link
Author

allo- commented May 25, 2023

#3800 is still an issue here, even when applying 9613d1f. I think it should be discussed in the other bug, though.

@totaam
Copy link
Collaborator

totaam commented May 25, 2023

You're right, I tagged the wrong ticket.

@alexdelorenzo
Copy link
Contributor

Anyone who runs into this issue on Arch Linux needs to install libayatana-appindicator.

@totaam
Copy link
Collaborator

totaam commented Dec 2, 2023

@alexdelorenzo please bug your mantainer, this should be included as part of the xpra client's dependencies.

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

No branches or pull requests

3 participants