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

Icon missing / App tracking broken in Gnome/Wayland #541

Closed
bochecha opened this issue Feb 7, 2020 · 9 comments · Fixed by #556
Closed

Icon missing / App tracking broken in Gnome/Wayland #541

bochecha opened this issue Feb 7, 2020 · 9 comments · Fixed by #556
Milestone

Comments

@bochecha
Copy link
Contributor

bochecha commented Feb 7, 2020

I think #538 broke app tracking somehow.

I just updated and restarted Hamster, now GNOME Shell doesn't manage to figure out that the running instance corresponds ot the desktop file.

Here's what I see in the dash, observe how the running icon is separate from the launcher:

dash-hamster

And here's alt+tab:

alt-tab-hamster

@ederag
Copy link
Collaborator

ederag commented Feb 7, 2020

Just to bisect, that was not the case when you reviewed the first commits ?

Not the case in ubuntu-19.04 gnome wayland
(but there is no icon in the left bar (the dash ?) altogether...)
Maybe you have remnants of a previous install ?

@ederag
Copy link
Collaborator

ederag commented Feb 7, 2020

Learned a few things about icons,
but that's actually a Gnome/wayland issue:
Screenshot_20200207_215411
Under Gnome/Xorg, the icon is there:
Screenshot_20200207_215708

Look like this:

When I launch Firefox, the GNOME shell integrated title is 'firefox' instead of 'Firefox' as the .desktop file specifies, and there is no icon for the application

Following panoptigram advice,

hamster --name org.gnome.Hamster.GUI

works.

But the name is now "org.gnome.Hamster.GUI" in the top bar.
Ugly...
I'm going either to reverse the renaming, so much for flatpak,
or leave it at that,
unless someone has another solution.

@bochecha if the icon renaming required for flatpak solves this issues, then let's do it.

@ederag ederag changed the title App tracking is broken Icon missing under Gnome/Wayland Feb 7, 2020
@ederag
Copy link
Collaborator

ederag commented Feb 8, 2020

Renaming done in #542 , did not solve anything. Giving up.

@bochecha
Copy link
Contributor Author

bochecha commented Feb 8, 2020

Just to bisect, that was not the case when you reviewed the first commits ?

I never tested those, I only reviewed the code change.

Renaming done in #542 , did not solve anything. Giving up.

Yes, because I'm pretty sure it's an app tracking issue, not an icon one: GNOME Shell doesn't associate the running instance with the desktop file used to launch it. The missing icon is a side-effect of that app tracking problem.

@ederag
Copy link
Collaborator

ederag commented Feb 8, 2020

Understood, I now see why the previous title made sense.
In my case I do not see the splitting
(when launching from the activities search, there is a single entry appearing to the left,
no icon at all).
So let's keep the current title as in both cases an icon is missing. But agreed, there is more to that.
What is your distribution / desktop ?

It might be related to the icon though, as I suspect that looking at the icon name is one of the heuristics
mentioned in https://wiki.gnome.org/Projects/GnomeShell/ApplicationBased

Note: it's recommended that you use the same identifier for
your application id, .desktop file, .service file, and application icon.
This allows the Shell to match all your assets to the application,
and prepares your application for sandboxing.

They also say

Ensure that your application's .desktop file has StartupNotify=true

Would you try ?

@bochecha
Copy link
Contributor Author

bochecha commented Feb 8, 2020

In my case I do not see the splitting
(when launching from the activities search, there is a single entry appearing to the left,
no icon at all).

In the screenshot above I have two entries because the one with the icon is the launcher that I added to the dash ("Add to Favourites"), the one without icon is the running instance.

Having an icon for the second entry would still be wrong, because there really needs to be a single entry for both the launcher and the running instance.

What is your distribution / desktop ?

Fedora Workstation 31, with GNOME 3.34.

Ensure that your application's .desktop file has StartupNotify=true

Would you try ?

I will try on Monday. (I only have Hamster on my work computer)

I also asked the GNOME Shell developers, and they had this to day:

<jadahl> iirc with gtk you should set.. something.. to that app id. cant remember exactly what, maybe g_set_prgname()?

I can also try that on Monday.

@ederag
Copy link
Collaborator

ederag commented Feb 8, 2020

there really needs to be a single entry for both the launcher and the running instance

Indeed, that's why I added "agreed, there is more to that"
I just meant that someone facing this would certainly find this issue,
since the icon would be missing as well.
Or am I missing a point (that's highly possible) ?

About the prgname, it looks like the hamster --name attempt above.
Worked, but the result was too ugly.

I can also try that on Monday.

That would be great !
I'm going to release 3.0-beta tomorrow to keep the schedule and
hopefully attract the attention of a packager for ubuntu.
We'll have about one week before 3.0-rc1.

@ederag ederag changed the title Icon missing under Gnome/Wayland Icon missing / App tracking broken in Gnome/Wayland Feb 8, 2020
@mwilck
Copy link
Contributor

mwilck commented Feb 12, 2020

I think I found the problem.

GtkApplication must call GLib.set_prgname() explicitly in startup(). See gtk#653, set_prgname() example.
You'd expect GtkApplication to set this automatically from the application_id, but that's not the case.

Basically, this is equivalent to using the --name option. Unlike @bochecha, this does not cause the ugly org.gnome.Hamster.GUI name to be displayed in the GNOME panel.

@bochecha
Copy link
Contributor Author

bochecha commented Feb 12, 2020

I think I found the problem.

GtkApplication must call GLib.set_prgname() explicitly in startup(). See gtk#653, set_prgname() example.
You'd expect GtkApplication to set this automatically from the application_id, but that's not the case.

Right, this is what we were discussing just above, and I was supposed to test it on Monday but completely dropped the ball.

Thank you for confirming.

Basically, this is equivalent to using the --name option. Unlike @bochecha, this does not cause the ugly org.gnome.Hamster.GUI name to be displayed in the GNOME panel.

I hadn't tested that, @ederag was the one observing this. I get the same as you, using --name org.gnome.Hamster.GUI works just fine for me.

IMHO the best fix is to call GLib.set_prgname() explicitly, because it fixes all cases, including when people run Hamster in the CLI. I see you've already sent a pull request doing just that. 🙂

@ederag ederag added this to the v3.0 milestone Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants