[libtaskmanager] Consider _GTK_APPLICATION_ID for matching desktop files

Despite our best effors we currently do not match Gedit windows to their desktop file. It manages to evade all of our heuristics.

There is a reliable way to map it and other GTK apps though, the _GTK_APPLICATION_ID window property, which is more or less the same as our desktopFileName property
wilder-5.25
Nicolas Fella 4 years ago
parent 192702ca89
commit 5fb9cc4316
  1. 8
      libtaskmanager/xwindowtasksmodel.cpp

@ -32,8 +32,8 @@ namespace TaskManager
{
static const NET::Properties windowInfoFlags =
NET::WMState | NET::XAWMState | NET::WMDesktop | NET::WMVisibleName | NET::WMGeometry | NET::WMFrameExtents | NET::WMWindowType | NET::WMPid;
static const NET::Properties2 windowInfoFlags2 =
NET::WM2DesktopFileName | NET::WM2Activities | NET::WM2WindowClass | NET::WM2AllowedActions | NET::WM2AppMenuObjectPath | NET::WM2AppMenuServiceName;
static const NET::Properties2 windowInfoFlags2 = NET::WM2DesktopFileName | NET::WM2Activities | NET::WM2WindowClass | NET::WM2AllowedActions
| NET::WM2AppMenuObjectPath | NET::WM2AppMenuServiceName | NET::WM2GTKApplicationId;
class Q_DECL_HIDDEN XWindowTasksModel::Private
{
@ -494,6 +494,10 @@ QUrl XWindowTasksModel::Private::windowUrl(WId window)
QString desktopFile = QString::fromUtf8(info->desktopFileName());
if (desktopFile.isEmpty()) {
desktopFile = QString::fromUtf8(info->gtkApplicationId());
}
if (!desktopFile.isEmpty()) {
KService::Ptr service = KService::serviceByStorageId(desktopFile);

Loading…
Cancel
Save