Bug 439982

Summary: kdesrc-build --run does not set icon for application window on wayland
Product: [Developer tools] kdesrc-build Reporter: Andrew Shark <ashark>
Component: generalAssignee: Michael Pyne <mpyne>
Status: RESOLVED INTENTIONAL    
Severity: normal    
Priority: NOR    
Version: Git   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Andrew Shark 2021-07-17 19:37:35 UTC
When I run locally built krdc with `kdesrc-run krdc`, I noticed that it has generic wayland icon in the window (left top corner).

The krdc application itself implements things properly, i.e. uses reverse domain named desktop file and use kaboutapp class that makes icon to work on wayland. I checked distro version of krdc on wayland, and it showed icon normally.

STEPS TO REPRODUCE
1. Follow the https://community.kde.org/Get_Involved/development with krdc application
2. Run `kdesrc-build krdc`, then `kdesrc-run krdc`
3. Look at the main window icon at the top left corner

OBSERVED RESULT
The icon is generic wayland icon (letter w).

EXPECTED RESULT
The icon should be krdc.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.3
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2
Graphics Platform: Wayland
kdesrc-build version: at commit 5327bd Jul 8 00:20:18 2021

ADDITIONAL INFORMATION
If I install a distro version of krdc, then run local version with `krdc-run krdc` on wayland, I see it _has_ a proper icon. That makes me think krdc-run searches  icons in system specific folders, but not in local folders.
Comment 1 Andrew Shark 2024-01-29 14:29:52 UTC
Somewhere the XDG_DATA_DIRS is incorrectly set. The development application ignores `$install-dir/share` (`install-dir` as configured in kdesrc-buildrc), and reads from system path.
Comment 2 Andrew Shark 2024-01-29 23:47:34 UTC
Actually, no. When running `kdesrc-run konsole` (but not with `kdesrc-build --run konsole`) and executing there the `env | grep XDG_DATA_DIR` command, I can see that the XDG_DATA_DIR is set correctly. The first path is /home/andrew/kde6/usr/share, which is expected. It is configured in /home/andrew/kde6/build/konsole/prefix.sh.

It means that the reason of incorrectly set icon is somewhere else.
Comment 3 Andrew Shark 2024-03-02 16:54:50 UTC
It seems it is impossible to do after kwin has started. Also, even if modify system's XDG_DATA_DIR to contain dev path first, then normal app also will have that modified icon. In other words, in a single kwin session it is impossible to have different icons for the apps (dev and normal).

I only can think now of some hacky ways, such as making a window rule triggered by window title to apply custom desktop file.