client - handlie class names with a space and guess first word as dsktp

stolen idea from moksha - wrote it differently :)
@feat
This commit is contained in:
Carsten Haitzler 2022-12-12 19:03:14 +00:00
parent a6c68aaf5e
commit 6122bf24bb
1 changed files with 23 additions and 0 deletions

View File

@ -2298,6 +2298,29 @@ _e_client_eval(E_Client *ec)
}
}
}
if (!ec->desktop && ec->icccm.class)
{
const char *p = strchr(ec->icccm.class, ' ');
if (p)
{
char *sp, *dup = strdup(ec->icccm.class);
if (dup)
{
for (sp = dup; *dup; sp++)
{
if (*sp == ' ')
{
*sp = 0;
break;
}
}
ec->desktop = efreet_util_desktop_exec_find(dup);
free(dup);
}
}
}
if (!ec->desktop && ec->icccm.name)
{
/* this works for most cases as fallback. useful when app is