After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790200 - The main window has no icon under Mate desktop
The main window has no icon under Mate desktop
Status: RESOLVED DUPLICATE of bug 787029
Product: gnome-photos
Classification: Applications
Component: general
3.22.x
Other All
: Normal normal
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-11-11 05:04 UTC by Chingkai Chu
Modified: 2018-01-06 13:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot under mate desktop (116.89 KB, image/png)
2017-11-11 05:04 UTC, Chingkai Chu
  Details
photos-application-set-window-icon.patch (863 bytes, patch)
2017-11-11 05:09 UTC, Chingkai Chu
reviewed Details | Review
screenshot after applying the patch (35.68 KB, image/png)
2017-11-11 05:11 UTC, Chingkai Chu
  Details

Description Chingkai Chu 2017-11-11 05:04:51 UTC
Created attachment 363383 [details]
screenshot under mate desktop

Environment:
Fedora25 with Mate desktop

Steps:
1. Boot into Mate desktop
2. Launch gnome-photos found that the icon at the upper left corner was shown as 
   a red circle button, and the icon in the task bar was also missing.
   (see the screenshot)

Related bug in gnome-todo:
- https://bugzilla.gnome.org/show_bug.cgi?id=782268#c6
Comment 1 Chingkai Chu 2017-11-11 05:09:25 UTC
Created attachment 363384 [details] [review]
photos-application-set-window-icon.patch

I have tested this patch in my system via Flatpak+Builder and the icons are shown correctly.
Comment 2 Chingkai Chu 2017-11-11 05:11:25 UTC
Created attachment 363385 [details]
screenshot after applying the patch
Comment 3 Umang Jain 2018-01-05 14:28:59 UTC
Review of attachment 363384 [details] [review]:

Thanks for the patch. I'll wait for Debarshi to just take a look and move forward.

::: src/photos-application.c
@@ +1860,3 @@
   icon_theme = gtk_icon_theme_get_default ();
   gtk_icon_theme_add_resource_path (icon_theme, "/org/gnome/Photos/icons");
+  gtk_window_set_default_icon_name ("org.gnome.Photos");

++
Comment 4 Debarshi Ray 2018-01-05 14:44:31 UTC
Two quick questions:

(a) What happens in gnome-shell's classic mode?

(b) What about other applications (say, gnome-clocks, gnome-documents, nautilus, totem, etc.) running under MATE?
Comment 5 Debarshi Ray 2018-01-05 19:30:07 UTC
(In reply to Debarshi Ray from comment #4)
> Two quick questions:
> 
> (a) What happens in gnome-shell's classic mode?

It works, the Photos icon is present.

> (b) What about other applications (say, gnome-clocks, gnome-documents,
> nautilus, totem, etc.) running under MATE?

Some of them do call gtk_window_set_default_icon_name.
Comment 6 Debarshi Ray 2018-01-05 19:49:59 UTC
Review of attachment 363384 [details] [review]:

We discussed this in #gtk+ on GIMPNet.

Long story short, this is needed only for X sessions run by some non-GNOME environments. GNOME on X works without it, and it has no effect on Wayland. Given that we are moving towards Wayland, it makes more sense to update MATE instead of asking relatively young GNOME applications to carry X-specific settings for non-GNOME environments.

A lengthier explanation follows:

::: src/photos-application.c
@@ +1860,3 @@
   icon_theme = gtk_icon_theme_get_default ();
   gtk_icon_theme_add_resource_path (icon_theme, "/org/gnome/Photos/icons");
+  gtk_window_set_default_icon_name ("org.gnome.Photos");

What this does, is set the _NET_WM_ICON of the window. Try throwing xprop at it under X.

GNOME Shell picks up the application icon from the Icon key in the desktop file, which is looked up using the application ID or the WM_CLASS. Failing that, on X, it uses _NET_WM_ICON.

Note:
  * gnome-photos' application ID does match the desktop file, and even though its WM_CLASS didn't, that's enough for GNOME Shell to locate the icon. I have now fixed WM_CLASS too.
  * Coincidentally, the Icon matches the desktop file name, but that's not important.

Sadly, _NET_WM_ICON is a X concept without any Wayland equivalent.

Even though a lot of applications do set _NET_WM_ICON, I don't want to add yet another little setting to the startup for the sake of non-GNOME X sessions. Most applications which set _NET_WM_ICON do so for historical reasons when X was the only display server around, but that's not the case anymore. These days, as a general rule, we should be moving away from X-specific concepts as opposed to adding more of them, especially when things can work without them.

Note:
  * _NET_WM_ICON is not needed for GNOME's X session either.
  * This is *GNOME* Photos. It's raison d'etre is to provide a first class experience on GNOME. It already doesn't work out of the box on environments that disable Tracker, don't offer GNOME Online Accounts or gnome-settings-daemon, etc.. So, unless there is a significant influx of users or development resources from non-GNOME environments, such compatibility crutches are a bit futile.

This change can have interesting side effects if someday we change the icon in the desktop file. Most people won't realize that the _NET_WM_ICON needs to updated in tandem, because an overwhelming percentage of users and contributors of the app use GNOME.

I'd suggest that MATE's gnome-panel and metacity forks be updated to not use _NET_WM_ICON.
Comment 7 Debarshi Ray 2018-01-06 13:12:01 UTC
The desktop file has "OnlyShowIn=GNOME;", which makes me wonder how you got it to show up in MATE.
Comment 8 Debarshi Ray 2018-01-06 13:20:15 UTC

*** This bug has been marked as a duplicate of bug 787029 ***