QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
543 stars 48 forks source link

Port Qubes widgets to use StatusNotifierItem #8410

Open tasket opened 1 year ago

tasket commented 1 year ago

How to file a helpful issue

Qubes OS release

4.2rc1, updated with current-testing including:

kde-settings-qubes-5.12.3-8 plasma-breeze-qubes-5.12.3-8

Brief summary

After installing and switching to KDE in dom0, none of the Qubes widgets such as qui-domains and qui-devices are visible/usable.

Note that KDE now defaults to Wayland and this issue does not occur when selecting an X11 session.

Steps to reproduce

Install KDE: sudo qubes-dom0-update kde-settings-qubes

Also make the changes for lightdm->sddm.

On edit: Also select 'Wayland' session when logging in.

Expected behavior

Qubes widgets appear when logging in to desktop.

Actual behavior

Somewhat normal KDE startup, except no Qubes widgets (and the App Launcher appears in the center of the screen, not near the widget). They are not listed under the hidden menu, and configuring systray doesn't list any Qubes widgets. The standard KDE widgets are present.

Related

Issues #8326 #8159 #8187 #3366

tasket commented 1 year ago

If I try to run qui-devices directly in the shell I get:

Gtk-CRITICAL **: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed

...and then two theme parsing errors for 'gtk.css' saying '-gtk-icon-size is not a valid property name'.

Also, the program just hangs after the errors until I hit Ctrl-C.

tasket commented 1 year ago

Switching the desktop session from Wayland to X11 appears to get everything working again. It appears recent versions of KDE default to Wayland.

The KDE doc probably should be updated to instruct the user to select X11.

DemiMarie commented 1 year ago

The KDE doc probably should be updated to instruct the user to select X11.

I’d rather fix the problems with Wayland. Xorg is deprecated and there is some hardware it simply cannot support properly. Xwayland has no problems on this hardware. Additionally, Qubes will eventually be Wayland-native, so this needs to be fixed anyway.

Assigning @marmarta since she maintains this code.

tasket commented 1 year ago

In that case, this might be a duplicate of a generic Wayland issue if one already exists.

DemiMarie commented 1 year ago

In that case, this might be a duplicate of a generic Wayland issue if one already exists.

Not a duplicate, but possibly a subtask.

marmarta commented 1 year ago

It looks like a Wayland problem. It does not support tray status icons.

DemiMarie commented 1 year ago

I changed the title of the issue to reflect the work that actually needs to be done.

marmarta commented 1 year ago

This is blocked by all gtk wayland-compatible statusnotifier icons that I know of (libappindicator and libayatana-appindicator) not supporting tooltips on the icon.

DemiMarie commented 1 year ago

@marmarta Alternative is to use underlying D-Bus API directly; I’m willing to help with that. The C libraries just use D-Bus under the hood.

DemiMarie commented 9 months ago

There are a few problems here:

  1. The menus under KDE try to use Wayland, rather than X11, but this fails rather miserably. Workaround: WAYLAND_DISPLAY= in the environment.
  2. KDE + Wayland doesn’t support X11 tray icons natively. It tries to translate them to StatusNotifierItem, but this translation is buggy and does not work reliably.
  3. Ayatana indicators are not packaged in Fedora.
  4. Ayatana indicators do not support tooltips, but there is a PR (AyatanaIndicators/libayatana-appindicator#17) that adds that support.
  5. AyatanaIndicators/libayatana-appindicator#17 PR is known to cause segfaults under GNOME when Ubuntu’s GNOME tray icon extension, but seems to work under KDE and XFCE. This is almost certainly a memory unsafety problem in C.

Personally, my preference remains writing the whole thing in Python, mostly because that means that both @marmarta and I can actually understand what is happening, and that problems show up as Python exceptions and not random segfaults.

marmarta commented 8 months ago

well, as usual, I don't think writing and supporting a whole library up from scratch is a feasible solution. For me it just sounds like KDE+Wayland is not really working yet.

DemiMarie commented 8 months ago

@marmarta want me to report a bug in KDE?

marmarta commented 8 months ago

@marmarta want me to report a bug in KDE?

You're the person testing it - and you know that all I know about it is what we tested together on a call. Do what you think is right.

DemiMarie commented 8 months ago

Tray icons not working is definitely a KDE bug: https://bugs.kde.org/show_bug.cgi?id=468085. There are two options I can think of, and both should avoid needing to rewrite all of the widgets:

  1. Switch to Ayatana indicators and use the out-of-tree patch https://github.com/AyatanaIndicators/libayatana-appindicator/pull/17.
  2. Fix the bug in KDE and run the tray icon under Xwayland.
marmarek commented 14 hours ago

The current plan is for @DemiMarie to find the best solution and prepare a PoC that shows it actually works, and how to use it in Python.

Pasting a message from @marmarta: basic requirements for the POC are: