Move program title to "src/main.c"
This commit is contained in:
parent
9f1b2ef0da
commit
69e0c4185c
|
@ -1,7 +1,5 @@
|
||||||
/* See LICENSE file for copyright and license details. */
|
/* See LICENSE file for copyright and license details. */
|
||||||
|
|
||||||
static const char wm_name[] = "PolytreeWM";
|
|
||||||
|
|
||||||
/* appearance */
|
/* appearance */
|
||||||
|
|
||||||
static const char *fonts[] = { "monospace:size=10" };
|
static const char *fonts[] = { "monospace:size=10" };
|
||||||
|
|
12
src/dwm.c
12
src/dwm.c
|
@ -229,6 +229,8 @@ static void zoom(const Arg *arg);
|
||||||
* variables *
|
* variables *
|
||||||
*************/
|
*************/
|
||||||
|
|
||||||
|
static const char *program_title = NULL;
|
||||||
|
|
||||||
static struct Screen screen = {
|
static struct Screen screen = {
|
||||||
.sizes = { 0, 0 },
|
.sizes = { 0, 0 },
|
||||||
.x_screen = 0,
|
.x_screen = 0,
|
||||||
|
@ -280,8 +282,12 @@ static void (*handler[LASTEvent])(XEvent*) = {
|
||||||
* Public function implementations *
|
* 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()) {
|
if (!XSupportsLocale()) {
|
||||||
warning("no locale support in X");
|
warning("no locale support in X");
|
||||||
}
|
}
|
||||||
|
@ -2195,8 +2201,8 @@ void wmcheckwin_create()
|
||||||
8,
|
8,
|
||||||
PropModeReplace,
|
PropModeReplace,
|
||||||
(unsigned char*)
|
(unsigned char*)
|
||||||
wm_name,
|
program_title,
|
||||||
strlen(wm_name)
|
strlen(program_title)
|
||||||
);
|
);
|
||||||
XChangeProperty(
|
XChangeProperty(
|
||||||
dpy,
|
dpy,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef _DWM_H
|
#ifndef _DWM_H
|
||||||
#define _DWM_H
|
#define _DWM_H
|
||||||
|
|
||||||
int dwm_main();
|
int dwm_main(const char *program_title);
|
||||||
|
|
||||||
#endif // _DWM_H
|
#endif // _DWM_H
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#define PROGRAM_NAME "polytreewm"
|
#define PROGRAM_TITLE "PolytreeWM"
|
||||||
|
#define PROGRAM_NAME "polytreewm"
|
||||||
|
|
||||||
static char *program_exe = NULL;
|
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)
|
void signal_callback(const int signo)
|
||||||
|
|
Loading…
Reference in New Issue