Move program title to "src/main.c"

This commit is contained in:
Alex Kotov 2021-11-22 03:57:22 +05:00
parent 9f1b2ef0da
commit 69e0c4185c
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
4 changed files with 13 additions and 8 deletions

View File

@ -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" };

View File

@ -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,

View File

@ -1,6 +1,6 @@
#ifndef _DWM_H
#define _DWM_H
int dwm_main();
int dwm_main(const char *program_title);
#endif // _DWM_H

View File

@ -12,7 +12,8 @@
#include <sys/wait.h>
#include <unistd.h>
#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)