From b696bf7decceffdcca5683e1316f4b4f00976833 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Wed, 12 Jan 2022 00:10:41 +0100 Subject: [PATCH] x11client: Consider _GTK_APPLICATION_ID for matching desktop files --- src/x11client.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/x11client.cpp b/src/x11client.cpp index 9d4e1fdfe8..d5294c376d 100644 --- a/src/x11client.cpp +++ b/src/x11client.cpp @@ -403,7 +403,8 @@ bool X11Client::manage(xcb_window_t w, bool isMapped) NET::WM2IconPixmap | NET::WM2OpaqueRegion | NET::WM2DesktopFileName | - NET::WM2GTKFrameExtents; + NET::WM2GTKFrameExtents | + NET::WM2GTKApplicationId; auto wmClientLeaderCookie = fetchWmClientLeader(); 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 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(); connect(this, &X11Client::desktopFileNameChanged, this, &X11Client::getIcons);