Missing Icon in Plasma Task Manager

Hi, everyone!

I’m trying to package my application in a flatpak. The application is written in Lua, and is executed using a simple wrapper script:

cd /app/share/myapp
luajit myapp.lua

luajit is the binary interpreter installed in my flatpak. I’ve also set up a .desktop file that has a name, an icon, exec, and the other required fields. I can build the application and package it into a single .flatpak file, and then install it, no problem. The desktop entry appears in the main menu, with correct icon and everything else.

However, when I start the application, it creates a window (using wxWidgets on top of GTK), and that window has the default Wayland icon, both in the window decorations and in the task manager.

Checking the window properties says that the window class is luajit (same as the executable). I searched for the similar issues, and it seems that because of that, KDE Plasma can’t find the matching .desktop file and can’t display the correct icon. I’ve tried to set StartupWMClass in the desktop file to either luajit or my app’s flatpak ID, but none of those approaches worked. The only solution I could find is to rename the luajit executable inside my flatpak to the full flatpak ID of my app, and only then KWin detected the desktop file and set the icon properly.

While this works, I feel like this is not the right way to do it. Can anyone point me in the right direction?

You can try setting StartupWMClass to the same value as the Icon.

It doesn’t work, the window class is still luajit