2

OS: Ubuntu 24.04.1, Desktop: GNOME Shell 46.0, Window manager: Wayland

Long story short: multiple instances (different installations) of Eclipse IDE gets gnome-shell dash confused, and shows wrong icons and names during running 1 instance or multiple at a time, even after specifying StartupWMClass=Eclipse inside .desktop files.

So, what and where to specify unique identifier to avoid this confusion by gnome-shell dash? or is there anyway we can specify a unique StartupWMClass for every installation?

============================

Details: I'm using multiple instance of Eclipse IDE (JSE, JEE, PyDev and CDT), and they are all installed manually in different paths.

please see image here

Every .desktop file is has unique entries, except StartupWMClass=Eclipse, which i got from Looking class lg command.

e.g: the .desktop of JSE

[Desktop Entry]
Version=1.1
Type=Application
Name=JSE
Icon=/home/user/.local/bin/eclipse/jse/icon.png
Exec=/home/user/.local/bin/eclipse/jse/default/eclipse
Path=/home/user/.local/bin/eclipse/jse/workspace
Categories=Development;IDE;
StartupNotify=true
StartupWMClass=Eclipse

When I run any one of (JSE, JEE, PyDev or CDT), I got only CDT icon and name in gnome dash, but the application running is correctly launched (only name and icon wrong).

Any other launching of other instances (JSE, JEE, PyDev and CDT) will group the icon and name to the currently launched instance on gnome dash (with wrong name and icons)

please see image for JSE and JEE instances running

I've installed Eclipse from snap store, and it was working perfectly with no problems (not grouped with previous CDT icon and name in dash)

please see this image for Eclipse from snap

I checked the .desktop file of snap's Eclipse, and I found:

[Desktop Entry]
X-SnapInstanceName=eclipse
Version=1.0
Type=Application
Name=Eclipse
Icon=/snap/eclipse/124/usr/lib/eclipse/icon.xpm
X-SnapAppName=eclipse
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/eclipse_eclipse.desktop /snap/bin/eclipse %f
Comment=Eclipse IDE
Categories=Development;IDE;
Terminal=false
StartupWMClass=eclipse

I noticed that snapStartupWMClass=eclipse with small e, while lg command shows wmclass=Eclipse with capital E

please see lg command window image

So I think this is the key, by specifying unique StartupWMClass value, for every .desktop file of each installation, I'm I right?

Can someone tells me how to specify a unique StartupWMClass value for every different instance of Eclipse, or any other application.

============================

Update 1:

After reading a lot of threads, and Refer to answer in this thread and this manual link, Exec option --class does not work.

  • I'd check what release you're actually using, as if using 24.04.1 as stated; you're well behind on applying updates to your system (which may include security fixes), as 24.04.3 changes are rolling out currently, but installed systems should still report as 24.04.2 but will change to 24.04.3 soon.. (https://fridge.ubuntu.com/2025/02/20/ubuntu-24-04-2-lts-released/ shows ISO release date of 24.04.2 but installed systems upgraded to that two weeks prior to ISO release date that link refers to) – guiverc Jul 20 '25 at 00:16
  • Have you tried applying updates to your system, where details provided infer you've not been applying updates since early February 2025 or earlier if your details are accurate.. If you're trying to apply upgrades; your details imply you've other problems that may impact your security & would be what I'd be checking first... See prior comment. Ubuntu 24.04 LTS is the release; Desktop/Server is the product, and the final decimal number is your point release which reflects update level; your .1 shows you well behind, with .3 updates already rolling out, yet you've not applied the older .2??? – guiverc Jul 20 '25 at 02:06

1 Answers1

2

The application decides on the WMClass of its window. You therefore will depend on whether Eclipse provides a command line interface or another way to change the WMClass of the launched instance.

vanadium
  • 98,427
  • That is the point behind my question, how to change WMClass for eclipse or any other application to have multiple instances with different icons and names of the same app? – Abdullah D. Jul 20 '25 at 11:43
  • That is also the point of my answer: you need to look for the solution in the app itself, not in the operating system. I do not know whether there is a specific solution for Eclipse. I actually do not need to: this here is an Ubuntu site. With the answer, I at least gave you the pointer where to look. – vanadium Jul 20 '25 at 13:59