summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-25 14:44:23 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-25 14:44:23 +0100
commit680dee1daf2a2942bcc08bc7724ffcc52743202a (patch)
tree88676e8a966d0e0ab97e993877fa88a85a67fbc2 /src/lib
parent7f984ce4a55523f0062840c5b3b990a13fa06730 (diff)
efreet - work around conconforming apps putting startupwmclass in quotes
riot does StartupWMClass="Riot" https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html does not allow for quoting here. you can quote fields in an exec line - for shell and replacement purposes, but not other fields like this above. this is a workaround a broken app so matching window to desktop file works. @fix
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/efreet/efreet_desktop.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/efreet/efreet_desktop.c b/src/lib/efreet/efreet_desktop.c
index f0c46d4c33..4e97dc1efb 100644
--- a/src/lib/efreet/efreet_desktop.c
+++ b/src/lib/efreet/efreet_desktop.c
@@ -777,7 +777,22 @@ efreet_desktop_application_fields_parse(Efreet_Desktop *desktop, Efreet_Ini *ini
777 if (val) desktop->path = strdup(val); 777 if (val) desktop->path = strdup(val);
778 778
779 val = efreet_ini_string_get(ini, "StartupWMClass"); 779 val = efreet_ini_string_get(ini, "StartupWMClass");
780 if (val) desktop->startup_wm_class = strdup(val); 780 if ((val) && (val[0]) && (val[1]))
781 {
782 size_t len = strlen(val);
783 if (((val[0] == '"') && (val[len - 1] == '"') ) ||
784 ((val[0] == '\'') && (val[len - 1] == '\'')))
785 {
786 // fixup for some spec-violating apps that put startupwmclass
787 // in quotes... spec doesnt allow for this. just escapes.
788 char *tmpval = alloca(len - 1);
789 strncpy(tmpval, val + 1, len - 2);
790 tmpval[len - 2] = '\0';
791 desktop->startup_wm_class = strdup(tmpval);
792 }
793 else
794 desktop->startup_wm_class = strdup(val);
795 }
781 796
782 val = efreet_ini_string_get(ini, "Categories"); 797 val = efreet_ini_string_get(ini, "Categories");
783 if (val) 798 if (val)