Index: x11/xfce4-taskmanager/files/patch-src_app-manager.c =================================================================== --- x11/xfce4-taskmanager/files/patch-src_app-manager.c (nonexistent) +++ x11/xfce4-taskmanager/files/patch-src_app-manager.c (working copy) @@ -0,0 +1,60 @@ +--- src/app-manager.c 2018-05-30 22:29:22.000000000 +0300 ++++ src/app-manager.c 2018-06-21 12:08:04.839503000 +0300 +@@ -44,6 +44,7 @@ + static void apps_add_application (GArray *apps, WnckApplication *application, GPid pid); + static void apps_remove_application (GArray *apps, WnckApplication *application); + static App * apps_lookup_pid (GArray *apps, GPid pid); ++static App * apps_lookup_app (GArray *apps, WnckApplication *application); + static void application_opened (WnckScreen *screen, WnckApplication *application, XtmAppManager *manager); + static void application_closed (WnckScreen *screen, WnckApplication *application, XtmAppManager *manager); + +@@ -97,12 +98,17 @@ + app_get_pid(WnckApplication *application) + { + GPid pid; ++ GList *windows; ++ + if (NULL == application) + return (0); + pid = wnck_application_get_pid (application); + if (pid != 0) + return (pid); +- return (wnck_window_get_pid (WNCK_WINDOW (wnck_application_get_windows (application)->data))); ++ windows = wnck_application_get_windows (application); ++ if (NULL != windows && NULL != windows->data) ++ return (wnck_window_get_pid (WNCK_WINDOW (windows->data))); ++ return (0); + } + + static gint +@@ -135,6 +141,8 @@ + App *app = apps_lookup_pid(apps, app_get_pid (application)); + + if (app == NULL) ++ app = apps_lookup_app(apps, application); ++ if (app == NULL) + return; + g_object_unref (app->icon); + g_array_remove_index (apps, (guint)(((size_t)app - (size_t)apps->data) / sizeof(App))); +@@ -150,6 +158,21 @@ + return (bsearch(&tapp, apps->data, apps->len, sizeof(App), app_pid_compare_fn)); + } + ++static App * ++apps_lookup_app (GArray *apps, WnckApplication *application) ++{ ++ App *tapp; ++ guint i; ++ ++ for (i = 0; i < apps->len; i++) { ++ tapp = &g_array_index (apps, App, i); ++ if (tapp->application == application) ++ return (tapp); ++ } ++ ++ return (NULL); ++} ++ + static void + application_opened (WnckScreen *screen __unused, WnckApplication *application, XtmAppManager *manager) + { Index: x11/xfce4-taskmanager/files/patch-src_task-manager.c =================================================================== --- x11/xfce4-taskmanager/files/patch-src_task-manager.c (nonexistent) +++ x11/xfce4-taskmanager/files/patch-src_task-manager.c (working copy) @@ -0,0 +1,70 @@ +--- src/task-manager.c 2018-06-03 18:43:41.000000000 +0300 ++++ src/task-manager.c 2018-07-29 09:21:33.383945000 +0300 +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + #include "task-manager.h" + #ifdef HAVE_WNCK +@@ -125,12 +126,44 @@ + static gchar * + pretty_cmdline (gchar *cmdline, gchar *comm) + { +- /* Use the printable range of 0x20-0x7E */ +- const gchar *valid_chars = " !\"#$%&'()*+,-./0123456789:;<=>?@" +- "ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`" +- "abcdefghijklmnopqrstuvwxyz{|}~"; +- gchar *text = g_strstrip (g_strcanon (g_strdup (cmdline), valid_chars, ' ')); +- gsize text_size = (gsize)strlen (text); ++ gunichar c; ++ gchar *ch, *text_max, *text = g_strstrip (g_strdup (cmdline)); ++ gsize csize, text_size = (gsize)strlen (text); ++ ++ /* UTF-8 normalize. */ ++ do { ++ for (ch = text, text_max = (text + text_size); ++ text_max > ch; ++ text_max = (text + text_size), ch = g_utf8_next_char(ch)) { ++ c = g_utf8_get_char_validated(ch, -1); /* If use (text_max - ch) - result is worse. */ ++ if ((gunichar)-2 == c) { ++ text_size = (gsize)(ch - text); ++ (*ch) = 0; ++ break; ++ } ++ if ((gunichar)-1 == c) { ++ (*ch) = ' '; ++ continue; ++ } ++ csize = (gsize)g_unichar_to_utf8(c, NULL); ++ ++ if (!g_unichar_isdefined(c) || ++ !g_unichar_isprint(c) || ++ (g_unichar_isspace(c) && (1 != csize || (' ' != (*ch) && ' ' != (*ch)))) || ++ g_unichar_ismark(c) || ++ g_unichar_istitle(c) || ++ g_unichar_iswide(c) || ++ g_unichar_iszerowidth(c) || ++ g_unichar_iscntrl(c)) { ++ if (text_max < (ch + csize)) ++ break; ++ memmove(ch, (ch + csize), (gsize)(text_max - (ch + csize))); ++ text_size -= csize; ++ } ++ } ++ text[text_size] = 0; ++ } while (!g_utf8_validate(text, (gssize)text_size, NULL)); ++ + if (!full_cmdline && text_size > 3) + { + /* Shorten full path to commands and wine applications */ +@@ -139,7 +172,7 @@ + gchar *p = g_strstr_len (text, (gssize)text_size, comm); + if (p != NULL) + { +- g_strlcpy (text, p, text_size); ++ memmove (text, p, text_size); + } + } + }