From fa7743bc58430e2b99ec45700365ca6196447ad8 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Wed, 26 Apr 2017 17:40:32 -0400 Subject: [PATCH] libdockapp: Do not include pathnames in Window Name and Class Properties Patch by Corin-EU from GitHub [1]. In libdockapps file wmgeneral.c, wname is set from argv[0] and is then used to set the window name and class resource. Often applications are called with their full path which then means that the window name has a path in it, thereby requiring an unwieldy path specific string for "Name" in WMState if the applet is to be captured in the WM dock. The simple solution is that wname should be the basename of argv[0] to ensure that the window name for the applet is the simple and obvious one. Thus the inclusion of header file libgen.h is required. Just say "no" to path slashes "/" in window name/class resources .... [1] https://github.com/d-torrance/dockapps/issues/5 --- libdockapp/src/wmgeneral.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libdockapp/src/wmgeneral.c b/libdockapp/src/wmgeneral.c index c624193..b491502 100644 --- a/libdockapp/src/wmgeneral.c +++ b/libdockapp/src/wmgeneral.c @@ -69,6 +69,7 @@ #include /* for fprintf, stderr, NULL, etc */ #include /* for exit, free */ #include /* for strcmp, strdup, strcspn, etc */ +#include /* for basename */ /*****************/ /* X11 Variables */ @@ -396,7 +397,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit unsigned int borderwidth = 1; XClassHint classHint; char *display_name = NULL; - char *wname = argv[0]; + char *wname = basename (argv[0]); XTextProperty name; XGCValues gcv;