Bug 526678 (swtWaylandApplicationIconMissing) - [gtk][Wayland] Icon of Application (Shell?) is missing
Summary: [gtk][Wayland] Icon of Application (Shell?) is missing
Status: REOPENED
Alias: swtWaylandApplicationIconMissing
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.8   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
: 533150 559271 (view as bug list)
Depends on:
Blocks: 535260
  Show dependency tree
 
Reported: 2017-10-31 05:53 EDT by Michael Vorburger CLA
Modified: 2022-04-29 07:38 EDT (History)
10 users (show)

See Also:


Attachments
Screenshot of Alt-Tab on Fedora 26 under Wayland with Eclipse icon missing (351.76 KB, image/png)
2017-10-31 05:53 EDT, Michael Vorburger CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Vorburger CLA 2017-10-31 05:53:17 EDT
Created attachment 271257 [details]
Screenshot of Alt-Tab on Fedora 26 under Wayland with Eclipse icon missing

When running Eclipse IDE for Java Developers Version: Photon Milestone 2 (4.8.0M2) under Wayland in Fedora 26 then the "Application icon" (as in that  image that shows up e.g. when you Alt-Tab) is missing - see attached screenshot.
Comment 1 Leo Ufimtsev CLA 2017-10-31 14:43:55 EDT
Thanks for bug report.
Comment 2 Leo Ufimtsev CLA 2017-10-31 14:44:33 EDT
Eclipse on Wayland is still work in progress.
Comment 3 Alexander Kurtakov CLA 2017-11-27 08:20:16 EST
This works for me on Fedora 27 with latest I-build. Can you verify?
Comment 4 Michael Vorburger CLA 2017-11-27 08:34:06 EST
> This works for me on Fedora 27 with latest I-build. Can you verify?

yeah sure, I'll retry this.. I'm still on Fedora 26 not yet Fedora 27 but am grabbing a http://download.eclipse.org/eclipse/downloads/drops4/I20171126-2000/eclipse-SDK-I20171126-2000-linux-gtk-x86_64.tar.gz to see if it looks any different with that than with the Photon Milestone 2 (4.8.0M2)... 

FYI: it's DL'ing at 20 KB/s on the URL from http://download.eclipse.org/eclipse/downloads/ - so will I have few HOURS of DL left - doubt that's normal; if there's a better URL, please shout.
Comment 5 Michael Vorburger CLA 2017-11-27 10:32:39 EST
At least 4.8M3a still has it.  Latest I-build seems to be impossible to download.
Comment 6 Michael Vorburger CLA 2017-12-01 11:28:11 EST
I did now manage to DL an eclipse-SDK-I20171201-0600-linux-gtk-x86_64.tar.gz from http://download.eclipse.org/eclipse/downloads/drops4/I20171201-0600/ ("Eclipse SDK Version: Photon (4.8) Build id: I20171201-0600"), but am sorry to report that, I'm still not seeing the Application Icon on Alt-Tab in Wayland, at least on Fedora 26.

If you have reason to believe that Wayland lib differences between Fedora 26 and Fedora 27 are the cause of this, then just ignore me & this! ;)

It's certainly only a very minor issue though, of course!
Comment 7 Browser Ia CLA 2017-12-23 20:07:01 EST
I also have this problem with 4.8 M3 & M4 under Fedora 27. It is not fixed.
Comment 8 Michael Arnold CLA 2018-01-23 09:08:18 EST
I am also experiencing this issue with Fedora 27 and Eclipse CDT Oxygen.2 Release (4.7.2).

Interestingly there are two workarounds under X11:
Workaround 1: copy the eclipse icon (icon.xpm) to /usr/share/icons/hicolor/256x256/apps/Eclipse.xpm and then in /usr/share/applications/EclipseCDT.desktop add the line:
	Icon=Eclipse.xpm
Workaround 2: add the following line to in /usr/share/applications/EclipseCDT.desktop:
	Icon=/path/to/eclipse/icon.xpm
Thus, this issue looks more like an inconsistency in gnome between X11 and wayland and is thus possibly not really an eclipse defect...
Comment 9 Michael Arnold CLA 2018-01-24 09:51:12 EST
It seems that this same issue existed for LibreOffice:
https://bugzilla.redhat.com/show_bug.cgi?id=1334915 and

But that the upstream escalation did not progress:
https://bugzilla.gnome.org/show_bug.cgi?id=779143 (GTK unlikely to change behaviour)

The workaround for LibreOffice was merged (and is certainly working in F27), but I can't figure out how to navigate to the code diff
https://bodhi.fedoraproject.org/updates/FEDORA-2017-36bc8a20e4
Comment 10 Michael Arnold CLA 2018-01-24 10:40:00 EST
Caolán (who provided the fix for LibreOffice) kindly shared the following:
"
https://cgit.freedesktop.org/libreoffice/core/commit/?id=6903066822900a
700ccf67ae70fa171c94644a9a was the fix for the LibreOffice problem. But
our problem was our desire to change the icon for the window so we can
change a startcenter window to a writer window to e.g. an impress
window and have different icons. Which can't be done with the gtk apis
under wayland.

It may be that your problem is different. Perhaps change the xpm to a
png ?
"
Comment 11 Dani Megert CLA 2018-04-05 08:05:06 EDT
*** Bug 533150 has been marked as a duplicate of this bug. ***
Comment 12 Andreas Sewe CLA 2018-09-16 12:04:39 EDT
FYI, this is still an issue with 2018-09 RC2 under Ubuntu 18.04 with Gnome (not Ubuntu!) desktop on Wayland.
Comment 13 Eric Williams CLA 2018-12-06 13:20:39 EST
I no longer see this issue on Fedora 29.
Comment 14 Michael Vorburger CLA 2018-12-06 14:59:28 EST
(In reply to Eric Williams from comment #13)
> I no longer see this issue on Fedora 29.

I'm still seeing it on Fedora 28 (using a Wayland instead of a X11 session, of course) using Eclipse Version: 2018-09 (4.9.0), Build id: 20180917-1800, just rechecked; but I guess something in the very latest Wayland version used in Fedora 29, not in SWT, fixed this?  Let's just close it as NOT_ECLIPSE then.  (Should I still see it when I upgrade from Fedora 28 to 29 I'll re-open it.)
Comment 15 Eric Williams CLA 2018-12-06 15:00:33 EST
(In reply to Michael Vorburger from comment #14)
> (In reply to Eric Williams from comment #13)
> > I no longer see this issue on Fedora 29.
> 
> I'm still seeing it on Fedora 28 (using a Wayland instead of a X11 session,
> of course) using Eclipse Version: 2018-09 (4.9.0), Build id: 20180917-1800,
> just rechecked; but I guess something in the very latest Wayland version
> used in Fedora 29, not in SWT, fixed this?  Let's just close it as
> NOT_ECLIPSE then.  (Should I still see it when I upgrade from Fedora 28 to
> 29 I'll re-open it.)

Works for me. :)
Comment 16 Michael Vorburger CLA 2018-12-06 15:09:34 EST
> I'm still seeing it on Fedora 28 (using a Wayland instead of a X11 session,
> of course) using Eclipse Version: 2018-09 (4.9.0), Build id: 20180917-1800,

as well as on Version: 2018-12 M2 (4.10.0M2) Build id: 20181108-1653 on Fedora 28
Comment 17 Michael Vorburger CLA 2019-01-16 08:32:39 EST
> > > I no longer see this issue on Fedora 29.
> > 
> > I'm still seeing it on Fedora 28 (using a Wayland instead of a X11 session,
> > of course) using Eclipse Version: 2018-09 (4.9.0), Build id: 20180917-1800,
> > just rechecked; but I guess something in the very latest Wayland version
> > used in Fedora 29, not in SWT, fixed this?  Let's just close it as
> > NOT_ECLIPSE then.  (Should I still see it when I upgrade from Fedora 28 to
> > 29 I'll re-open it.)
> 
> Works for me. :)

re-opening as I'm still seeing this after having finally upgraded to Fedora 29:

Using Eclipse IDE for Java Developers Version: 2018-12 (4.10.0) Build id: 20181214-0600, installed by standard Oomph model (not using vorburger/opendaylight-eclipse-setup).

I've double checked that I was both in a Wayland and not X11 desktop session and furthermore that my Eclipse was actually running under Wayland and not the "legacy X11 server provided with Wayland for compatibility purposes" (using "xwininfo" and "xlsclients" as described on https://docs.fedoraproject.org/en-US/fedora/f29/system-administrators-guide/Wayland/ and https://fedoraproject.org/wiki/How_to_debug_Wayland_problems).
Comment 18 Alexander Kurtakov CLA 2019-01-16 09:04:35 EST
Xi, please investigate the issue. I confirm it now on Fedora 29.
Comment 19 Alexander Kurtakov CLA 2019-01-17 06:15:05 EST
So wayland and xdg-shell do not support setting icon directly. It must be set via desktop file and there is no sane way for eclipse to generate one and install it in ~/.local and be unique for each unzip and etc. Note that desktop files must contain absolute paths so installs can not be roaming.
See https://gitlab.gnome.org/GNOME/gtk/blob/master/gdk/wayland/gdksurface-wayland.c#L3275 for the stup even on Gtk 4. 
P.S. It's worth opening a bug against Gtk to at least document that in the function docs.
Comment 20 Alexander Kurtakov CLA 2019-01-17 06:20:24 EST
Looks like shipping Eclipse as flatpak will become mandatory for proper wayland work. Michael, please try http://eclipse.matbooth.co.uk/flatpak/ and let us know if/what is broken for you.
Comment 21 Michael Vorburger CLA 2019-01-17 09:51:21 EST
It works with the Flatpaack installation.  But I need Oomph... ;-)

> So wayland and xdg-shell do not support setting icon directly.
> It must be set via desktop file and there is no sane way for eclipse to 

Oh!  I see.  May bad - I indeed created my own .desktop file - but didn't think that was relevant until this clarification - had assumed the .desktop file was just for the GNOME menu, and that launched process would then use some API to set its icon. This seems a bit weird to me (how would e.g. a UI process started on the CLI without a .desktop file ever get an icon), but be that as it may, it is so.

But I couldn't help myself :() and started digging into this for a moment... 

My .desktop file, created initially by hand or using "alacarte" (can't remember) had Icon=/home/vorburger/dev/ODL/eclipses/2018-09/eclipse/icon.xpm

The /var/lib/flatpak/app/org.eclipse.Sdk/current/active/files/share/applications/org.eclipse.Sdk.desktop has Icon=org.eclipse.Sdk ... so I gathered I could just do the same?

cp -R /var/lib/flatpak/app/org.eclipse.Sdk/current/active/files/share/icons/ ~/.local/share/ copies those nice hi-res Eclipse icons (instead of icon.xpm) to where I gather they need to be for "normal" (non-Flatpack) usage?

Now I change Icon=org.eclipse.Sdk in my .desktop, but nope, still NOK... :-( Perhaps I made a typo or something, so I install the Menu Editor UI "menulibre", which seems to be more modern than "alacarte" and which for new Application Launcher Icons allows choosing not just to Browse Files (XPM) but also Browse Icons - where "org.eclipse.Sdk" indeed shows up now - but it's STILL NOK... 

I'm probably missing something? There is also /var/lib/flatpak/app/org.eclipse.Sdk/current/active/export/share/icons/, but there is no ~/.local/share/export so nothing to copy there.  Ditto /var/lib/flatpak/app/org.eclipse.Sdk/current/active/files/share/app-info/icons/flatpak but again there is no equivalent in ~/.local/share/ as far as I can see.  (So these flat packs have desktop icons in 3 locations, huh?)

Long story short - ignore me! ;) Sorry for the noise, given above, this clearly isn't an Eclipse (as in code) "bug".  I'll continue to live without that icon!  I'll let you close it as you see fit.  Unless someone has a magic tip...
Comment 22 Xi Yan CLA 2019-01-17 11:28:17 EST
(In reply to Alexander Kurtakov from comment #19)
> So wayland and xdg-shell do not support setting icon directly. 

I've opened an issue against GTK for this: https://gitlab.gnome.org/GNOME/gtk/issues/1602
Comment 23 Alexander Kurtakov CLA 2020-01-17 03:31:59 EST
*** Bug 559271 has been marked as a duplicate of this bug. ***
Comment 24 Kain Centeno CLA 2021-09-07 12:18:43 EDT
(In reply to Xi Yan from comment #22)
> (In reply to Alexander Kurtakov from comment #19)
> > So wayland and xdg-shell do not support setting icon directly. 
> 
> I've opened an issue against GTK for this:
> https://gitlab.gnome.org/GNOME/gtk/issues/1602

The issue was closed 2 years ago with the following:

```
The documentation for gtk_window_set_icon() already states:

Some window managers or desktop environments may also place it in the window frame, or display it in other contexts.
On others, the icon is not used at all, so your mileage may vary.

So it's not just a matter of X11 vs Wayland (vs Windows vs macOS vs …) but also it depends on the actual window manager in use. In this specific case, GNOME Shell uses the icon coming from the desktop file, instead of having a special method on either the xdg-shell public interface, or the gtk-shell private one. There's nothing inside Wayland that prevents creating such method.
I don't really think this needs to be clarified any further.
```
Comment 25 Kain Centeno CLA 2021-09-07 12:19:09 EDT
(In reply to Xi Yan from comment #22)
> (In reply to Alexander Kurtakov from comment #19)
> > So wayland and xdg-shell do not support setting icon directly. 
> 
> I've opened an issue against GTK for this:
> https://gitlab.gnome.org/GNOME/gtk/issues/1602

The issue was closed 2 years ago with the following:

```
The documentation for gtk_window_set_icon() already states:

Some window managers or desktop environments may also place it in the window frame, or display it in other contexts.
On others, the icon is not used at all, so your mileage may vary.

So it's not just a matter of X11 vs Wayland (vs Windows vs macOS vs …) but also it depends on the actual window manager in use. In this specific case, GNOME Shell uses the icon coming from the desktop file, instead of having a special method on either the xdg-shell public interface, or the gtk-shell private one. There's nothing inside Wayland that prevents creating such method.
I don't really think this needs to be clarified any further.
```
Comment 26 Lorenzo Bettini CLA 2022-04-29 07:38:03 EDT
Actually, I have .desktop files for my Eclipse installations, pointing to icons, e.g.,

[Desktop Entry]
Version=Latest
Name=Eclipse Xtext
Comment=Eclipse Xtext IDE
Exec= ... full path to ... eclipse
Icon= ... full path to ... icon-xtext.xpm
Terminal=false
Type=Application
Categories=Utility;Application;Development;

but the icon is not shown when Eclipse has been launched, e.g., in the task switcher or the dock (in Wayland)

So what should I do to have icons correctly shown?