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

No icon on wingpanel after updated to 7.0.0 #203

Closed
bobby285271 opened this issue Jun 28, 2023 · 10 comments · Fixed by #204
Closed

No icon on wingpanel after updated to 7.0.0 #203

bobby285271 opened this issue Jun 28, 2023 · 10 comments · Fixed by #204

Comments

@bobby285271
Copy link
Member

bobby285271 commented Jun 28, 2023

What Happened?

As shown in the screenshot, wingpanel (the top panel) is missing a bluetooth icon:

Steps to Reproduce

  1. Boot to Pantheon updates 2023-06-28 NixOS/nixpkgs#240261
  2. See the wingpanel?

Expected Behavior

Icon appears.

OS Version

Other Linux

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

@bobby285271
Copy link
Member Author

bobby285271 commented Jun 28, 2023

I am looking at #196 since this is probably the only icon-related change in this bump (edit: and reverting it fixes the issue)

In NixOS/nixpkgs#240261 I am also testing a wingpanel-indicator-notifications bump, which has very similar change, but it looks like the wingpanel-indicator-notifications icon still works fine.

@bobby285271
Copy link
Member Author

bobby285271 commented Jun 28, 2023

I found the icon actually appears fine in greeter/lock screen, it is just missing in a desktop session 🤔

I also managed to reproduce this on a fresh VM (by forcing the indicator to be visible).

@tintou
Copy link
Member

tintou commented Jun 28, 2023

@danirabbit I believe that we are missing Gtk.IconTheme.get_default ().add_resource_path ("/org/elementary/wingpanel/icons") at some place.

Also, <gresource prefix="org/elementary/wingpanel/icons"> is missing the leading slash

@tintou
Copy link
Member

tintou commented Jun 28, 2023

I would personally change it for /io/elementary/wingpanel/bluetooth/icons to avoid prefix clash

@danirabbit
Copy link
Member

Hm I'm not able to reproduce this.

@tintou It's namespaced that way intentionally so that Gtk.Application loads the resource into the icon path automatically and don't need to manually add it

@tintou
Copy link
Member

tintou commented Jun 28, 2023

Ah true, we still need the leading slash though

@jeremypw
Copy link
Collaborator

Perhaps the automatic loading of the resource to the icon theme is not happening on NixOS for some reason. This issue does not occur on elementary.

@bobby285271
Copy link
Member Author

bobby285271 commented Jun 28, 2023

Yeah from my testing a explicit add_resource_path does fixes the issue for me, i.e.

diff --git a/src/Widgets/DisplayWidget.vala b/src/Widgets/DisplayWidget.vala
index daded09..bb7ce5e 100644
--- a/src/Widgets/DisplayWidget.vala
+++ b/src/Widgets/DisplayWidget.vala
@@ -25,6 +25,9 @@ public class BluetoothIndicator.Widgets.DisplayWidget : Gtk.Spinner {
     }
 
     construct {
+        weak Gtk.IconTheme default_theme = Gtk.IconTheme.get_default ();
+        default_theme.add_resource_path ("/org/elementary/wingpanel/icons");
+
         var provider = new Gtk.CssProvider ();
         provider.load_from_resource ("io/elementary/wingpanel/bluetooth/indicator.css");

And from testing it sounds like doing this also helps other indicators, i.e. after adding this patch I found elementary/wingpanel-indicator-nightlight#101 (comment) fixed too.

/sos @jtojnar 🙃 Any chance our https://github.com/NixOS/nixpkgs/blob/master/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix are breaking automatic loading resource here?

@tintou
Copy link
Member

tintou commented Jun 28, 2023

@danirabbit I believe that the autoloading of resources is done too early in the process when the indicators are not already loaded, and as they are plugins it might be the case, I propose to use some explicit loading to be on the safe side even in elementary

@danirabbit danirabbit moved this to Todo in OS 7.1 Jun 28, 2023
@danirabbit
Copy link
Member

Sounds good, I'll make a branch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants