My application is in the selected taskbar(GNOME, dash-to-panel). When a window opens, a new icon appears in the taskbar. How to make so that the favorites icon is activated and a new one does not appear (as in other applications: Gedit, Nautilus)
Answer: Need a correct StartupWMClass entry. Find entry: in a terminal xprop WM_CLASS
Sounds like you don't have a launcher, in GNOME environments usually a .desktop file. This file tells the desktop which kind of application your app is, allows you to create right-click actions (such as New Window, New Private Window, etc.). Here is an example:
[Desktop Entry]
Name=<Name of Your App>
Exec=<command to execute>
Terminal=<true/false depending on whether you run it on a terminal>
Icon=<name of the icon for your app (icon has to be installed on the system)>
Type=Application
Categories=<Office;Game;etc; (semi-colon separated)>
Keywords=Something;Other Thing;
There is a good guide by GNOME here.