Bug 464229 - mainwindow icon bug
Summary: mainwindow icon bug
Status: RESOLVED FIXED
Alias: None
Product: kleopatra
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Andre Heinecke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-13 08:43 UTC by fxzxmic
Modified: 2023-02-12 03:42 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
bug related screenshot (28.17 KB, image/png)
2023-01-13 08:43 UTC, fxzxmic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fxzxmic 2023-01-13 08:43:03 UTC
Created attachment 155255 [details]
bug related screenshot

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
Please see the attached screenshot, using the normally displayed software "konversation" for comparison.

STEPS TO REPRODUCE
1. Launch kleopatra
2. See the main window

OBSERVED RESULT
The software icon does not exist on the mainwindow.
 
EXPECTED RESULT
The software icon exists on the mainwindow.

SOFTWARE/OS VERSIONS
Windows: NO
macOS: NO
Linux/KDE Plasma: NO
(available in About System)
KDE Plasma Version: NO
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
It seems that setWindowIcon() is needed in the main().
Maybe this is helpful: https://invent.kde.org/network/konversation/-/blob/master/src/main.cpp#L99 .
Comment 1 Friedrich W. H. Kossebau 2023-01-13 09:05:54 UTC
As commented on irc, I suspect the cause is that the window manager used here is an X11 one which only fetches the window icons from the X properties directly, does not map the _KDE_NET_WM_DESKTOP_FILE to a desktop file to fetch metadata like the app icon.

For those one still needs to set the window icon directly, e.g. by adding
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kleopatra"), app.windowIcon())); 
to  https://invent.kde.org/pim/kleopatra/-/blob/master/src/main.cpp#L128

While at it, all the app metadata setting is better moved to before  the  "// Initialize GpgME" section, otherwise e.g. the text in the warning message will not be translated properly I expect as well as the window again missing needed metadata to be nicely shown as Kleopatra window.
Comment 2 Ingo Klöcker 2023-01-20 14:15:07 UTC
Git commit 9dfe6709cff75f777310968bb30151599e68dd0c by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 20/01/2023 at 14:14.
Pushed by kloecker into branch 'master'.

Explicitly set the window icon

Apparently, some window managers need the icon to be set explicitly.

M  +2    -0    src/main.cpp

https://invent.kde.org/pim/kleopatra/commit/9dfe6709cff75f777310968bb30151599e68dd0c
Comment 3 fxzxmic 2023-02-12 03:42:24 UTC
Which version will this change be included in?