diff --git a/src/config.def.h b/src/config.def.h index 42191b6..be75b39 100644 --- a/src/config.def.h +++ b/src/config.def.h @@ -1,7 +1,5 @@ /* See LICENSE file for copyright and license details. */ -static const char wm_name[] = "PolytreeWM"; - /* appearance */ static const char *fonts[] = { "monospace:size=10" }; diff --git a/src/dwm.c b/src/dwm.c index caea1ee..aa4bdec 100644 --- a/src/dwm.c +++ b/src/dwm.c @@ -229,6 +229,8 @@ static void zoom(const Arg *arg); * variables * *************/ +static const char *program_title = NULL; + static struct Screen screen = { .sizes = { 0, 0 }, .x_screen = 0, @@ -280,8 +282,12 @@ static void (*handler[LASTEvent])(XEvent*) = { * Public function implementations * ***********************************/ -int dwm_main() +int dwm_main(const char *const new_program_title) { + if (!(program_title = new_program_title)) { + fatal("no program title is given"); + } + if (!XSupportsLocale()) { warning("no locale support in X"); } @@ -2195,8 +2201,8 @@ void wmcheckwin_create() 8, PropModeReplace, (unsigned char*) - wm_name, - strlen(wm_name) + program_title, + strlen(program_title) ); XChangeProperty( dpy, diff --git a/src/dwm.h b/src/dwm.h index 988888b..39c3451 100644 --- a/src/dwm.h +++ b/src/dwm.h @@ -1,6 +1,6 @@ #ifndef _DWM_H #define _DWM_H -int dwm_main(); +int dwm_main(const char *program_title); #endif // _DWM_H diff --git a/src/main.c b/src/main.c index 0948e16..b7d9944 100644 --- a/src/main.c +++ b/src/main.c @@ -12,7 +12,8 @@ #include #include -#define PROGRAM_NAME "polytreewm" +#define PROGRAM_TITLE "PolytreeWM" +#define PROGRAM_NAME "polytreewm" static char *program_exe = NULL; @@ -57,7 +58,7 @@ int main(int argc, char *argv[]) } } - exit(dwm_main(argc, argv)); + exit(dwm_main(PROGRAM_TITLE)); } void signal_callback(const int signo)