Score:2

GNOME stop detecting opened desktop apps instances on dash to dock

pk flag

Sometimes GNOME's dash to dock add-on loses open app instances and launch a new one, when I already am using one instance, this is not a workspace issue because the apps are opened in same workspace. It just loses tracing of what is open and launches again and it's very anoying.

It is happening on Ubuntu 20.04.2 LTS and GNOME Shell 3.36.9

Anybody knows what it could be??

FedKad avatar
cn flag
Can it be due to having more than one `.desktop` file for the same application in your environment?
Score:2
ro flag

If you are using Xorg, Gnome uses an app's WM_CLASS property to locate the instances of an app. Every application has a .desktop file and there is a field named StartupWMClass. Gnome reads this field to identify the app's instances. Some applications do not include the StartupWMClass field in its desktop file. This might be causing the issue. To fix it follow these steps:

  1. Go to /usr/share/applications folder and search for the app's name. You will find a desktop file associated with that app, let's say foo.desktop. Copy that file to ~/.local/share/applications (~ stands for the user's home directory).

  2. Open the affected app. Open up a terminal and run xprop WM_CLASS. The cursor will change to a plus sign. Then click on the affected app. A line will be printed to the terminal something like: WM_CLASS(STRING) = 'foo'

  3. Now open the copied file in step 1 using a text editor. At the end of the file add a line StartupWMClass=<wm_class>. Replace wm_class with the output you got in the previous step without quotes. eg.- StartupWMClass=foo

Save the file, then relaunch the app and the problem should be fixed.

Note that this will only work in Xorg because AFAIK, Wayland doesn't require the StartupWMClass property.

Javier avatar
vn flag
What if the app does not have its `.desktop` file in `/usr/share/applications`?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.