Set icon to wayland if desktop file is not found
Summary: For X windows KWin uses the generic X icon if no icon is found. Thus KWin should use the generic Wayland icon if no icon is found for a Wayland client. With this change applications with incorrect desktop file name at least get a generic icon instead of no icon. Test Plan: Started Qt assistant on Wayland and it had icon. Reviewers: #kwin, #plasma_on_wayland Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D3023
This commit is contained in:
parent
9eede1c66b
commit
8201def97f
1 changed files with 4 additions and 2 deletions
|
@ -1155,18 +1155,20 @@ bool ShellClient::hasStrut() const
|
|||
|
||||
void ShellClient::updateIcon()
|
||||
{
|
||||
const QString waylandIconName = QStringLiteral("wayland");
|
||||
QString desktopFile;
|
||||
if (m_shellSurface) {
|
||||
desktopFile = QString::fromUtf8(m_shellSurface->windowClass());
|
||||
}
|
||||
if (desktopFile.isEmpty()) {
|
||||
setIcon(QIcon());
|
||||
setIcon(QIcon::fromTheme(waylandIconName));
|
||||
}
|
||||
if (!desktopFile.endsWith(QLatin1String(".desktop"))) {
|
||||
desktopFile.append(QLatin1String(".desktop"));
|
||||
}
|
||||
KDesktopFile df(desktopFile);
|
||||
setIcon(QIcon::fromTheme(df.readIcon()));
|
||||
const QString iconName = df.readIcon();
|
||||
setIcon(QIcon::fromTheme(iconName.isEmpty() ? waylandIconName : iconName));
|
||||
}
|
||||
|
||||
bool ShellClient::isTransient() const
|
||||
|
|
Loading…
Reference in a new issue