mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
General cleanup.
ok okan@.
This commit is contained in:
parent
53116c4ec3
commit
3bb0b451f7
12
calmwm.c
12
calmwm.c
@ -52,14 +52,14 @@ int
|
|||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
const char *conffile = NULL;
|
const char *conf_file = NULL;
|
||||||
|
|
||||||
char *display_name = NULL;
|
char *display_name = NULL;
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "c:d:")) != -1) {
|
while ((ch = getopt(argc, argv, "c:d:")) != -1) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'c':
|
case 'c':
|
||||||
conffile = optarg;
|
conf_file = optarg;
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
display_name = optarg;
|
display_name = optarg;
|
||||||
@ -82,7 +82,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
Starting = 1;
|
Starting = 1;
|
||||||
bzero(&Conf, sizeof(Conf));
|
bzero(&Conf, sizeof(Conf));
|
||||||
conf_setup(&Conf, conffile);
|
conf_setup(&Conf, conf_file);
|
||||||
client_setup();
|
client_setup();
|
||||||
x_setup(display_name);
|
x_setup(display_name);
|
||||||
Starting = 0;
|
Starting = 0;
|
||||||
@ -238,7 +238,7 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
|
|||||||
LeaveWindowMask|ColormapChangeMask|ButtonMask;
|
LeaveWindowMask|ColormapChangeMask|ButtonMask;
|
||||||
|
|
||||||
XChangeWindowAttributes(X_Dpy, sc->rootwin,
|
XChangeWindowAttributes(X_Dpy, sc->rootwin,
|
||||||
/* CWCursor| */CWEventMask, &rootattr);
|
CWEventMask, &rootattr);
|
||||||
|
|
||||||
XSync(X_Dpy, False);
|
XSync(X_Dpy, False);
|
||||||
|
|
||||||
@ -257,10 +257,10 @@ x_screenname(int which)
|
|||||||
|
|
||||||
dstr = xstrdup(DisplayString(X_Dpy));
|
dstr = xstrdup(DisplayString(X_Dpy));
|
||||||
|
|
||||||
if ((cp = rindex(dstr, ':')) == NULL)
|
if ((cp = strrchr(dstr, ':')) == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
if ((cp = index(cp, '.')) != NULL)
|
if ((cp = strchr(cp, '.')) != NULL)
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
|
|
||||||
snlen = strlen(dstr) + 3; /* string, dot, number, null */
|
snlen = strlen(dstr) + 3; /* string, dot, number, null */
|
||||||
|
6
conf.c
6
conf.c
@ -157,9 +157,9 @@ conf_init(struct conf *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
conf_setup(struct conf *c, const char *conffile)
|
conf_setup(struct conf *c, const char *conf_file)
|
||||||
{
|
{
|
||||||
if (conffile == NULL) {
|
if (conf_file == NULL) {
|
||||||
char *home = getenv("HOME");
|
char *home = getenv("HOME");
|
||||||
|
|
||||||
if (home == NULL)
|
if (home == NULL)
|
||||||
@ -168,7 +168,7 @@ conf_setup(struct conf *c, const char *conffile)
|
|||||||
snprintf(c->conf_path, sizeof(c->conf_path), "%s/%s", home,
|
snprintf(c->conf_path, sizeof(c->conf_path), "%s/%s", home,
|
||||||
CONFFILE);
|
CONFFILE);
|
||||||
} else
|
} else
|
||||||
snprintf(c->conf_path, sizeof(c->conf_path), "%s", conffile);
|
snprintf(c->conf_path, sizeof(c->conf_path), "%s", conf_file);
|
||||||
|
|
||||||
conf_init(c);
|
conf_init(c);
|
||||||
|
|
||||||
|
20
kbfunc.c
20
kbfunc.c
@ -46,9 +46,9 @@ kbfunc_client_raise(struct client_ctx *cc, void *arg)
|
|||||||
void
|
void
|
||||||
kbfunc_moveresize(struct client_ctx *cc, void *arg)
|
kbfunc_moveresize(struct client_ctx *cc, void *arg)
|
||||||
{
|
{
|
||||||
struct screen_ctx *sc = screen_current();
|
struct screen_ctx *sc = screen_current();
|
||||||
int x,y,flags,amt;
|
int x, y, flags, amt;
|
||||||
u_int mx,my;
|
u_int mx, my;
|
||||||
|
|
||||||
mx = my = 0;
|
mx = my = 0;
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ kbfunc_moveresize(struct client_ctx *cc, void *arg)
|
|||||||
|
|
||||||
if (flags & CWM_BIGMOVE) {
|
if (flags & CWM_BIGMOVE) {
|
||||||
flags -= CWM_BIGMOVE;
|
flags -= CWM_BIGMOVE;
|
||||||
amt = amt*10;
|
amt = amt * 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (flags & movemask) {
|
switch (flags & movemask) {
|
||||||
@ -115,9 +115,9 @@ kbfunc_moveresize(struct client_ctx *cc, void *arg)
|
|||||||
void
|
void
|
||||||
kbfunc_client_search(struct client_ctx *scratch, void *arg)
|
kbfunc_client_search(struct client_ctx *scratch, void *arg)
|
||||||
{
|
{
|
||||||
struct menu_q menuq;
|
struct menu_q menuq;
|
||||||
struct client_ctx *cc, *old_cc = client_current();
|
struct client_ctx *cc, *old_cc = client_current();
|
||||||
struct menu *mi;
|
struct menu *mi;
|
||||||
|
|
||||||
TAILQ_INIT(&menuq);
|
TAILQ_INIT(&menuq);
|
||||||
|
|
||||||
@ -149,9 +149,9 @@ kbfunc_client_search(struct client_ctx *scratch, void *arg)
|
|||||||
void
|
void
|
||||||
kbfunc_menu_search(struct client_ctx *scratch, void *arg)
|
kbfunc_menu_search(struct client_ctx *scratch, void *arg)
|
||||||
{
|
{
|
||||||
struct menu_q menuq;
|
struct menu_q menuq;
|
||||||
struct menu *mi;
|
struct menu *mi;
|
||||||
struct cmd *cmd;
|
struct cmd *cmd;
|
||||||
|
|
||||||
TAILQ_INIT(&menuq);
|
TAILQ_INIT(&menuq);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user