manatools / dnfdragora

dnfdragora is a dnf frontend based on libyui abstraction
GNU General Public License v3.0
137 stars 41 forks source link

Main window reported as Python3 in Gnome 3 #169

Open szpak opened 4 years ago

szpak commented 4 years ago

The main dnfdragora window is reported as Python3 (instead of dnfdragora) in Gnome 3:

image

image

$ rpm -qa | grep dnfdragora
dnfdragora-2.1.0-2.fc32.noarch
dnfdragora-updater-2.1.0-2.fc32.noarch
Conan-Kudo commented 4 years ago

That's odd, because we set the title in the application:

https://github.com/manatools/dnfdragora/blob/acaa41e511c3ce026a9123fe494bd017cbfb99db/dnfdragora/ui.py#L384

And the desktop file has the correct name as well:

https://github.com/manatools/dnfdragora/blob/acaa41e511c3ce026a9123fe494bd017cbfb99db/share/applications/org.mageia.dnfdragora.desktop#L2

szpak commented 4 years ago

The Window is titled ok: image

however, Gnome 3 reports it as Python3 showing open apps.

When I open it from the launcher it behaves the same (Python3 when launched), even though I see dnfdragora in the application search window - taken from the desktop file.

szpak commented 4 years ago

Based on the SO knowledge, it seems that Gnome Shell uses WMClass to determine the application name.

For dummy "hello world" Gnome 3 app, adding the following line did a trick:

self.set_wmclass ("My App", "My App")

image

Maybe it could also achieved with yui.

anaselli commented 4 years ago

that says

The set_wmclass() method sets the X Window System "class" and "name" hints for a window. Applications should not call this method. According to the ICCCM, you should always set these to the same value for all windows in an application, and PyGTK sets them to that value by default, so calling this method is sort of pointless. However, you may want to call the set_role() method on each window in your application, for the benefit of the session manager. Setting the role allows the window manager to restore window positions when loading a saved session.

Anyway we don't use PyGTK but libyui-gtk so maybe we must check a way to fix it there or into bindings maybe?

alastortenebris commented 2 years ago

This might be related, but the KDE Wayland taskbar groups mcomix3, another python3 based app, with dnfdragora. I don't think it's just GNOME.

Also dnfdragora's icon doesn't appear in the KDE taskbar but that might be a KDE issue.

This is on Fedora 35's dnfdragora 2.1.0.