App icons under wayland show as a W

Barry Scott barry at barrys-emacs.org
Wed May 12 13:14:50 BST 2021



> On 11 May 2021, at 23:12, David Boddie <david at boddie.org.uk> wrote:
> 
> On Tue May 11 20:44:20 BST 2021, Barry Scott wrote:
> 
>> Both my PyQt5 apps when run under wayland do not show there app icons.
>> What I see is a W icon, that I'm assuming is the wayland default.
>> 
>> When the same app is run under X11 the app icon shows fine.
>> 
>> Does anyone know why this happens and how to fix it?
> 
> How are you setting the icon? Are you also setting the application name?

I use the setWindowIcon() on my main window passing a QIcon object that
was created from a resource built into the app.

> 
> The reason I ask is because I encountered an issue with GTK applications
> where the application name/ID needed to match the program name in order
> for Wayland to match up the application with its icon.

What is "application name/ID" in this context?
Is it the name of the .desktop file?
Is it the filename of the Exec= line in the .desktop file?
Is it the filename of the running process?

> 
> However, maybe the problem is less extreme with Qt-based applications.
> There is a guide about Wayland for KDE application developers and maybe
> you will find this section useful:
> 
> https://community.kde.org/Guidelines_and_HOWTOs/
> Wayland_Porting_Notes#Application_Icon

That guide has me part way fixed.

I have fixed up the naming of the .desktop file to match its rules.
I call setDesktopFile() to set that desktop file.

That means that I can see my app icon in the task manager.

But the icon on top-right corner of the main window is still the
W. I have some more experiments to try and will update then.

BTW I'm going this under KDE Plasma desktop.

Barry

> 
> Good luck!
> 
> David
> 
> 



More information about the PyQt mailing list