x11client: Consider _GTK_APPLICATION_ID for matching desktop files

This commit is contained in:
Kai Uwe Broulik 2022-01-12 00:10:41 +01:00 committed by Vlad Zahorodnii
parent b656a43c90
commit b696bf7dec

View file

@ -403,7 +403,8 @@ bool X11Client::manage(xcb_window_t w, bool isMapped)
NET::WM2IconPixmap | NET::WM2IconPixmap |
NET::WM2OpaqueRegion | NET::WM2OpaqueRegion |
NET::WM2DesktopFileName | NET::WM2DesktopFileName |
NET::WM2GTKFrameExtents; NET::WM2GTKFrameExtents |
NET::WM2GTKApplicationId;
auto wmClientLeaderCookie = fetchWmClientLeader(); auto wmClientLeaderCookie = fetchWmClientLeader();
auto skipCloseAnimationCookie = fetchSkipCloseAnimation(); auto skipCloseAnimationCookie = fetchSkipCloseAnimation();
@ -456,7 +457,11 @@ bool X11Client::manage(xcb_window_t w, bool isMapped)
setModal((info->state() & NET::Modal) != 0); // Needs to be valid before handling groups setModal((info->state() & NET::Modal) != 0); // Needs to be valid before handling groups
readTransientProperty(transientCookie); readTransientProperty(transientCookie);
setDesktopFileName(rules()->checkDesktopFile(QByteArray(info->desktopFileName()), true).toUtf8()); QByteArray desktopFileName{info->desktopFileName()};
if (desktopFileName.isEmpty()) {
desktopFileName = info->gtkApplicationId();
}
setDesktopFileName(rules()->checkDesktopFile(desktopFileName, true).toUtf8());
getIcons(); getIcons();
connect(this, &X11Client::desktopFileNameChanged, this, &X11Client::getIcons); connect(this, &X11Client::desktopFileNameChanged, this, &X11Client::getIcons);