mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
huge amount of cleanup and dead code removal.
full description of changes: -remove fontlist, and all associated structures/calls, it's not needed. this also removes any doubt about leftover 9wm code (the list was borrowed from it). Since cwm now uses Xft for everything, the legacy font handling is just not needed. -add /* FALLTHROUGH */ comments into grab_{label,menu}. I actually didn't intend grab_menu to be a fallthrough, but it actually works quite well there, so remove the extra rectangle drawing. I love it when that happens. -remove a couple of unused prototypes that were obviously missed before. -remove a bunch of commented out or if 0ed out code. It doesn't look to be coming back anytime soon. -several functions returned an int, but this was never checked. most of them only failed if they failed to grab the pointer (thus the internal state didn't change), so just make them void and return early if this is the case. -remove several unused functions and some useless variables. knocks something like 200bytes off the stripped binary size for me. ok marc@, tested by several others.
This commit is contained in:
parent
1eed217b1c
commit
7fb2664f92
45
calmwm.c
45
calmwm.c
@ -22,7 +22,6 @@
|
|||||||
#include "calmwm.h"
|
#include "calmwm.h"
|
||||||
|
|
||||||
Display *X_Dpy;
|
Display *X_Dpy;
|
||||||
XFontStruct *X_Font;
|
|
||||||
|
|
||||||
Cursor Cursor_move;
|
Cursor Cursor_move;
|
||||||
Cursor Cursor_resize;
|
Cursor Cursor_resize;
|
||||||
@ -47,15 +46,6 @@ char *DefaultFontName;
|
|||||||
#define gray_height 2
|
#define gray_height 2
|
||||||
static char gray_bits[] = {0x02, 0x01};
|
static char gray_bits[] = {0x02, 0x01};
|
||||||
|
|
||||||
/* List borrowed from 9wm/rio */
|
|
||||||
char *tryfonts[] = {
|
|
||||||
"9x15bold",
|
|
||||||
"*-lucidatypewriter-bold-*-14-*-75-*",
|
|
||||||
"*-lucidatypewriter-medium-*-12-*-75-*",
|
|
||||||
"fixed",
|
|
||||||
"*",
|
|
||||||
NULL,
|
|
||||||
};
|
|
||||||
|
|
||||||
static void _sigchld_cb(int);
|
static void _sigchld_cb(int);
|
||||||
|
|
||||||
@ -140,15 +130,6 @@ x_setup(char *display_name)
|
|||||||
|
|
||||||
Doshape = XShapeQueryExtension(X_Dpy, &Shape_ev, &i);
|
Doshape = XShapeQueryExtension(X_Dpy, &Shape_ev, &i);
|
||||||
|
|
||||||
i = 0;
|
|
||||||
while ((fontname = tryfonts[i++]) != NULL) {
|
|
||||||
if ((X_Font = XLoadQueryFont(X_Dpy, fontname)) != NULL)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fontname == NULL)
|
|
||||||
errx(1, "Couldn't load any fonts.");
|
|
||||||
|
|
||||||
Nscreens = ScreenCount(X_Dpy);
|
Nscreens = ScreenCount(X_Dpy);
|
||||||
for (i = 0; i < (int)Nscreens; i++) {
|
for (i = 0; i < (int)Nscreens; i++) {
|
||||||
XMALLOC(sc, struct screen_ctx);
|
XMALLOC(sc, struct screen_ctx);
|
||||||
@ -158,13 +139,12 @@ x_setup(char *display_name)
|
|||||||
|
|
||||||
Cursor_move = XCreateFontCursor(X_Dpy, XC_fleur);
|
Cursor_move = XCreateFontCursor(X_Dpy, XC_fleur);
|
||||||
Cursor_resize = XCreateFontCursor(X_Dpy, XC_bottom_right_corner);
|
Cursor_resize = XCreateFontCursor(X_Dpy, XC_bottom_right_corner);
|
||||||
/* (used to be) XCreateFontCursor(X_Dpy, XC_hand1); */
|
|
||||||
Cursor_select = XCreateFontCursor(X_Dpy, XC_hand1);
|
Cursor_select = XCreateFontCursor(X_Dpy, XC_hand1);
|
||||||
Cursor_default = XCreateFontCursor(X_Dpy, XC_X_cursor);
|
Cursor_default = XCreateFontCursor(X_Dpy, XC_X_cursor);
|
||||||
Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow);
|
Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
x_setupscreen(struct screen_ctx *sc, u_int which)
|
x_setupscreen(struct screen_ctx *sc, u_int which)
|
||||||
{
|
{
|
||||||
XColor tmp;
|
XColor tmp;
|
||||||
@ -196,10 +176,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
|
|||||||
TAILQ_FOREACH(kb, &Conf.keybindingq, entry)
|
TAILQ_FOREACH(kb, &Conf.keybindingq, entry)
|
||||||
xu_key_grab(sc->rootwin, kb->modmask, kb->keysym);
|
xu_key_grab(sc->rootwin, kb->modmask, kb->keysym);
|
||||||
|
|
||||||
/* Special -- for alt state. */
|
|
||||||
/* xu_key_grab(sc->rootwin, 0, XK_Alt_L); */
|
|
||||||
/* xu_key_grab(sc->rootwin, 0, XK_Alt_R); */
|
|
||||||
|
|
||||||
sc->blackpixl = BlackPixel(X_Dpy, sc->which);
|
sc->blackpixl = BlackPixel(X_Dpy, sc->which);
|
||||||
sc->whitepixl = WhitePixel(X_Dpy, sc->which);
|
sc->whitepixl = WhitePixel(X_Dpy, sc->which);
|
||||||
sc->bluepixl = sc->fccolor.pixel;
|
sc->bluepixl = sc->fccolor.pixel;
|
||||||
@ -223,32 +199,21 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
|
|||||||
gv.function = GXxor;
|
gv.function = GXxor;
|
||||||
gv.line_width = 1;
|
gv.line_width = 1;
|
||||||
gv.subwindow_mode = IncludeInferiors;
|
gv.subwindow_mode = IncludeInferiors;
|
||||||
gv.font = X_Font->fid;
|
|
||||||
|
|
||||||
sc->gc = XCreateGC(X_Dpy, sc->rootwin,
|
sc->gc = XCreateGC(X_Dpy, sc->rootwin,
|
||||||
GCForeground|GCBackground|GCFunction|
|
GCForeground|GCBackground|GCFunction|
|
||||||
GCLineWidth|GCSubwindowMode|GCFont, &gv);
|
GCLineWidth|GCSubwindowMode, &gv);
|
||||||
|
|
||||||
#ifdef notyet
|
|
||||||
gv2.foreground = sc->blackpixl^sc->cyanpixl;
|
|
||||||
gv2.background = sc->cyanpixl;
|
|
||||||
gv2.function = GXxor;
|
|
||||||
gv2.line_width = 1;
|
|
||||||
gv2.subwindow_mode = IncludeInferiors;
|
|
||||||
gv2.font = X_Font->fid;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sc->hlgc = XCreateGC(X_Dpy, sc->rootwin,
|
sc->hlgc = XCreateGC(X_Dpy, sc->rootwin,
|
||||||
GCForeground|GCBackground|GCFunction|
|
GCForeground|GCBackground|GCFunction|
|
||||||
GCLineWidth|GCSubwindowMode|GCFont, &gv);
|
GCLineWidth|GCSubwindowMode, &gv);
|
||||||
|
|
||||||
gv1.function = GXinvert;
|
gv1.function = GXinvert;
|
||||||
gv1.subwindow_mode = IncludeInferiors;
|
gv1.subwindow_mode = IncludeInferiors;
|
||||||
gv1.line_width = 1;
|
gv1.line_width = 1;
|
||||||
gv1.font = X_Font->fid;
|
|
||||||
|
|
||||||
sc->invgc = XCreateGC(X_Dpy, sc->rootwin,
|
sc->invgc = XCreateGC(X_Dpy, sc->rootwin,
|
||||||
GCFunction|GCSubwindowMode|GCLineWidth|GCFont, &gv1);
|
GCFunction|GCSubwindowMode|GCLineWidth, &gv1);
|
||||||
|
|
||||||
font_init(sc);
|
font_init(sc);
|
||||||
DefaultFont = font_getx(sc, DefaultFontName);
|
DefaultFont = font_getx(sc, DefaultFontName);
|
||||||
@ -290,7 +255,7 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
|
|||||||
|
|
||||||
XSync(X_Dpy, False);
|
XSync(X_Dpy, False);
|
||||||
|
|
||||||
return (0);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
11
calmwm.h
11
calmwm.h
@ -311,8 +311,7 @@ int input_keycodetrans(KeyCode, u_int, enum ctltype *, char *, int);
|
|||||||
int x_errorhandler(Display *, XErrorEvent *);
|
int x_errorhandler(Display *, XErrorEvent *);
|
||||||
void x_setup(char *display_name);
|
void x_setup(char *display_name);
|
||||||
char *x_screenname(int);
|
char *x_screenname(int);
|
||||||
void x_loop(void);
|
void x_setupscreen(struct screen_ctx *, u_int);
|
||||||
int x_setupscreen(struct screen_ctx *, u_int);
|
|
||||||
|
|
||||||
struct client_ctx *client_find(Window);
|
struct client_ctx *client_find(Window);
|
||||||
void client_setup(void);
|
void client_setup(void);
|
||||||
@ -397,8 +396,8 @@ int dirent_isdir(char *);
|
|||||||
int dirent_islink(char *);
|
int dirent_islink(char *);
|
||||||
int u_spawn(char *);
|
int u_spawn(char *);
|
||||||
|
|
||||||
int grab_sweep(struct client_ctx *);
|
void grab_sweep(struct client_ctx *);
|
||||||
int grab_drag(struct client_ctx *);
|
void grab_drag(struct client_ctx *);
|
||||||
void grab_menuinit(struct screen_ctx *);
|
void grab_menuinit(struct screen_ctx *);
|
||||||
void *grab_menu(XButtonEvent *, struct menu_q *);
|
void *grab_menu(XButtonEvent *, struct menu_q *);
|
||||||
void grab_label(struct client_ctx *);
|
void grab_label(struct client_ctx *);
|
||||||
@ -472,8 +471,7 @@ void search_match_exec(struct menu_q *, struct menu_q *, char *);
|
|||||||
void search_rank_text(struct menu_q *, char *);
|
void search_rank_text(struct menu_q *, char *);
|
||||||
|
|
||||||
void group_init(void);
|
void group_init(void);
|
||||||
int group_new(void);
|
void group_select(int);
|
||||||
int group_select(int);
|
|
||||||
void group_enter(void);
|
void group_enter(void);
|
||||||
void group_exit(int);
|
void group_exit(int);
|
||||||
void group_click(struct client_ctx *);
|
void group_click(struct client_ctx *);
|
||||||
@ -509,7 +507,6 @@ struct fontdesc *font_getx(struct screen_ctx *sc, const char *name);
|
|||||||
/* Externs */
|
/* Externs */
|
||||||
|
|
||||||
extern Display *X_Dpy;
|
extern Display *X_Dpy;
|
||||||
extern XFontStruct *X_Font;
|
|
||||||
|
|
||||||
extern Cursor Cursor_move;
|
extern Cursor Cursor_move;
|
||||||
extern Cursor Cursor_resize;
|
extern Cursor Cursor_resize;
|
||||||
|
36
client.c
36
client.c
@ -266,15 +266,6 @@ client_leave(struct client_ctx *cc)
|
|||||||
xu_btn_ungrab(sc->rootwin, AnyModifier, Button1);
|
xu_btn_ungrab(sc->rootwin, AnyModifier, Button1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
client_nocurrent(void)
|
|
||||||
{
|
|
||||||
if (_curcc != NULL)
|
|
||||||
client_setactive(_curcc, 0);
|
|
||||||
|
|
||||||
_curcc = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
client_setactive(struct client_ctx *cc, int fg)
|
client_setactive(struct client_ctx *cc, int fg)
|
||||||
{
|
{
|
||||||
@ -361,19 +352,6 @@ client_maximize(struct client_ctx *cc)
|
|||||||
client_resize(cc);
|
client_resize(cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
client_push_geometry(struct client_ctx *cc)
|
|
||||||
{
|
|
||||||
cc->savegeom = cc->geom;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
client_restore_geometry(struct client_ctx *cc)
|
|
||||||
{
|
|
||||||
cc->geom = cc->savegeom;
|
|
||||||
client_resize(cc);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
client_resize(struct client_ctx *cc)
|
client_resize(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
@ -407,13 +385,6 @@ client_raise(struct client_ctx *cc)
|
|||||||
client_draw_border(cc);
|
client_draw_border(cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
client_warp(struct client_ctx *cc)
|
|
||||||
{
|
|
||||||
client_raise(cc);
|
|
||||||
xu_ptr_setpos(cc->pwin, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
client_ptrwarp(struct client_ctx *cc)
|
client_ptrwarp(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
@ -879,13 +850,6 @@ client_vertmaximize(struct client_ctx *cc)
|
|||||||
client_resize(cc);
|
client_resize(cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
client_map(struct client_ctx *cc)
|
|
||||||
{
|
|
||||||
/* mtf? */
|
|
||||||
client_ptrwarp(cc);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
client_mtf(struct client_ctx *cc)
|
client_mtf(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
|
30
conf.c
30
conf.c
@ -327,19 +327,6 @@ conf_get_int(struct client_ctx *cc, enum conftype ctype)
|
|||||||
return (val);
|
return (val);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
|
||||||
conf_get_str(struct client_ctx *cc, enum conftype ctype)
|
|
||||||
{
|
|
||||||
switch (ctype) {
|
|
||||||
case CONF_NOTIFIER:
|
|
||||||
return xstrdup("./notifier.py"); /* XXX */
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
conf_client(struct client_ctx *cc)
|
conf_client(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
@ -409,23 +396,6 @@ struct {
|
|||||||
{ NULL, NULL, 0, 0},
|
{ NULL, NULL, 0, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
|
||||||
conf_bindkey(struct conf *c, void (*arg_callback)(struct client_ctx *, void *),
|
|
||||||
int arg_keysym, int arg_modmask, int arg_flags, void * arg_arg)
|
|
||||||
{
|
|
||||||
struct keybinding *kb;
|
|
||||||
|
|
||||||
XMALLOC(kb, struct keybinding);
|
|
||||||
|
|
||||||
kb->modmask = arg_modmask;
|
|
||||||
kb->keysym = arg_keysym;
|
|
||||||
kb->keycode = 0;
|
|
||||||
kb->flags = arg_flags;
|
|
||||||
kb->callback = arg_callback;
|
|
||||||
kb->argument = arg_arg;
|
|
||||||
TAILQ_INSERT_TAIL(&c->keybindingq, kb, entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
conf_parsekeys(struct conf *c, char *filename)
|
conf_parsekeys(struct conf *c, char *filename)
|
||||||
{
|
{
|
||||||
|
18
grab.c
18
grab.c
@ -53,7 +53,7 @@ grab_sweep_draw(struct client_ctx *cc, int dx, int dy)
|
|||||||
wide/2 - wide_size/2, height + font_ascent(font) + 1);
|
wide/2 - wide_size/2, height + font_ascent(font) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
grab_sweep(struct client_ctx *cc)
|
grab_sweep(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
@ -68,7 +68,7 @@ grab_sweep(struct client_ctx *cc)
|
|||||||
client_ptrsave(cc);
|
client_ptrsave(cc);
|
||||||
|
|
||||||
if (xu_ptr_grab(sc->rootwin, MouseMask, Cursor_resize) < 0)
|
if (xu_ptr_grab(sc->rootwin, MouseMask, Cursor_resize) < 0)
|
||||||
return (-1);
|
return;
|
||||||
|
|
||||||
xu_ptr_setpos(cc->win, cc->geom.width, cc->geom.height);
|
xu_ptr_setpos(cc->win, cc->geom.width, cc->geom.height);
|
||||||
grab_sweep_draw(cc, dx, dy);
|
grab_sweep_draw(cc, dx, dy);
|
||||||
@ -101,13 +101,13 @@ grab_sweep(struct client_ctx *cc)
|
|||||||
XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0);
|
XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0);
|
||||||
xu_ptr_ungrab();
|
xu_ptr_ungrab();
|
||||||
client_ptrwarp(cc);
|
client_ptrwarp(cc);
|
||||||
return (0);
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
grab_drag(struct client_ctx *cc)
|
grab_drag(struct client_ctx *cc)
|
||||||
{
|
{
|
||||||
int x0 = cc->geom.x, y0 = cc->geom.y, xm, ym;
|
int x0 = cc->geom.x, y0 = cc->geom.y, xm, ym;
|
||||||
@ -117,7 +117,7 @@ grab_drag(struct client_ctx *cc)
|
|||||||
client_raise(cc);
|
client_raise(cc);
|
||||||
|
|
||||||
if (xu_ptr_grab(sc->rootwin, MouseMask, Cursor_move) < 0)
|
if (xu_ptr_grab(sc->rootwin, MouseMask, Cursor_move) < 0)
|
||||||
return (-1);
|
return;
|
||||||
|
|
||||||
xu_ptr_getpos(sc->rootwin, &xm, &ym);
|
xu_ptr_getpos(sc->rootwin, &xm, &ym);
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ grab_drag(struct client_ctx *cc)
|
|||||||
break;
|
break;
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
xu_ptr_ungrab();
|
xu_ptr_ungrab();
|
||||||
return (0);
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
@ -219,9 +219,7 @@ grab_menu(XButtonEvent *e, struct menu_q *menuq)
|
|||||||
sc->menuwin, fx, fy);
|
sc->menuwin, fx, fy);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (entry != -1)
|
/* FALLTHROUGH */
|
||||||
XFillRectangle(X_Dpy, sc->menuwin, sc->hlgc,
|
|
||||||
0, entry*height, width, height);
|
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
prev = entry;
|
prev = entry;
|
||||||
entry = menu_calc_entry(event.xbutton.x,
|
entry = menu_calc_entry(event.xbutton.x,
|
||||||
@ -320,7 +318,7 @@ grab_label(struct client_ctx *cc)
|
|||||||
xfree(cc->label);
|
xfree(cc->label);
|
||||||
|
|
||||||
cc->label = xstrdup(labelstr);
|
cc->label = xstrdup(labelstr);
|
||||||
|
/* FALLTHROUGH */
|
||||||
case CTL_ABORT:
|
case CTL_ABORT:
|
||||||
goto out;
|
goto out;
|
||||||
default:
|
default:
|
||||||
|
31
group.c
31
group.c
@ -197,36 +197,15 @@ group_init(void)
|
|||||||
* manipulate the 'current group'
|
* manipulate the 'current group'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* set current group to the first empty group
|
|
||||||
* returns 0 on success, -1 if there are no empty groups
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
group_new(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i=0; i < CALMWM_NGROUPS; i++) {
|
|
||||||
if (TAILQ_EMPTY(&Groups[i].clients)) {
|
|
||||||
Group_current = &Groups[i];
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (-1);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* change the current group */
|
/* change the current group */
|
||||||
int
|
void
|
||||||
group_select(int idx)
|
group_select(int idx)
|
||||||
{
|
{
|
||||||
struct group_ctx *gc = Group_current;
|
struct group_ctx *gc = Group_current;
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
|
|
||||||
if (idx < 0 || idx >= CALMWM_NGROUPS)
|
if (idx < 0 || idx >= CALMWM_NGROUPS)
|
||||||
return (-1);
|
return;
|
||||||
|
|
||||||
TAILQ_FOREACH(cc, &gc->clients, group_entry) {
|
TAILQ_FOREACH(cc, &gc->clients, group_entry) {
|
||||||
cc->highlight = 0;
|
cc->highlight = 0;
|
||||||
@ -237,7 +216,7 @@ group_select(int idx)
|
|||||||
Group_current = &Groups[idx];
|
Group_current = &Groups[idx];
|
||||||
|
|
||||||
group_display_draw(screen_current());
|
group_display_draw(screen_current());
|
||||||
return (0);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enter group mode */
|
/* enter group mode */
|
||||||
@ -353,7 +332,7 @@ void
|
|||||||
group_display_draw(struct screen_ctx *sc)
|
group_display_draw(struct screen_ctx *sc)
|
||||||
{
|
{
|
||||||
struct group_ctx *gc = Group_current;
|
struct group_ctx *gc = Group_current;
|
||||||
int x, y, dx, dy, fontheight, titlelen;
|
int x, y, dx, dy, fontheight;
|
||||||
struct client_ctx *cc;
|
struct client_ctx *cc;
|
||||||
char titlebuf[1024];
|
char titlebuf[1024];
|
||||||
struct fontdesc *font = DefaultFont;
|
struct fontdesc *font = DefaultFont;
|
||||||
@ -363,7 +342,7 @@ group_display_draw(struct screen_ctx *sc)
|
|||||||
x = y = 0;
|
x = y = 0;
|
||||||
|
|
||||||
fontheight = font_ascent(font) + font_descent(font) + 1;
|
fontheight = font_ascent(font) + font_descent(font) + 1;
|
||||||
dx = titlelen = font_width(font, titlebuf, strlen(titlebuf));
|
dx = font_width(font, titlebuf, strlen(titlebuf));
|
||||||
dy = fontheight;
|
dy = fontheight;
|
||||||
|
|
||||||
TAILQ_FOREACH(cc, &gc->clients, group_entry) {
|
TAILQ_FOREACH(cc, &gc->clients, group_entry) {
|
||||||
|
1
kbfunc.c
1
kbfunc.c
@ -171,7 +171,6 @@ kbfunc_client_search(struct client_ctx *scratch, void *arg)
|
|||||||
TAILQ_INIT(&menuq);
|
TAILQ_INIT(&menuq);
|
||||||
|
|
||||||
TAILQ_FOREACH(cc, &Clientq, entry) {
|
TAILQ_FOREACH(cc, &Clientq, entry) {
|
||||||
struct menu *mi;
|
|
||||||
XCALLOC(mi, struct menu);
|
XCALLOC(mi, struct menu);
|
||||||
strlcpy(mi->text, cc->name, sizeof(mi->text));
|
strlcpy(mi->text, cc->name, sizeof(mi->text));
|
||||||
mi->ctx = cc;
|
mi->ctx = cc;
|
||||||
|
6
search.c
6
search.c
@ -457,12 +457,6 @@ search_match_exec(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
|||||||
TAILQ_INSERT_TAIL(resultq, mi, resultentry);
|
TAILQ_INSERT_TAIL(resultq, mi, resultentry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
search_rank_text(struct menu_q *resultq, char *search)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_strsubmatch(char *sub, char *str, int zeroidx)
|
_strsubmatch(char *sub, char *str, int zeroidx)
|
||||||
{
|
{
|
||||||
|
7
util.c
7
util.c
@ -65,13 +65,6 @@ exec_wm(char *argstr)
|
|||||||
err(1, args[0]);
|
err(1, args[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int dirent_exists(char *filename) {
|
|
||||||
struct stat buffer;
|
|
||||||
|
|
||||||
return stat(filename, &buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
int dirent_isdir(char *filename) {
|
int dirent_isdir(char *filename) {
|
||||||
struct stat buffer;
|
struct stat buffer;
|
||||||
int return_value;
|
int return_value;
|
||||||
|
@ -27,8 +27,6 @@
|
|||||||
#include "headers.h"
|
#include "headers.h"
|
||||||
#include "calmwm.h"
|
#include "calmwm.h"
|
||||||
|
|
||||||
void _sendxmsg(Window, Atom, long);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE: in reality, many of these should move to client.c now that
|
* NOTE: in reality, many of these should move to client.c now that
|
||||||
* we've got this nice event layer.
|
* we've got this nice event layer.
|
||||||
|
21
xutil.c
21
xutil.c
@ -84,16 +84,6 @@ xu_key_grab(Window win, int mask, int keysym)
|
|||||||
|
|
||||||
XGrabKey(X_Dpy, XKeysymToKeycode(X_Dpy, keysym), mask, win, True,
|
XGrabKey(X_Dpy, XKeysymToKeycode(X_Dpy, keysym), mask, win, True,
|
||||||
GrabModeAsync, GrabModeAsync);
|
GrabModeAsync, GrabModeAsync);
|
||||||
#if 0
|
|
||||||
XGrabKey(X_Dpy, XKeysymToKeycode(X_Dpy, keysym), LockMask|mask,
|
|
||||||
win, True, GrabModeAsync, GrabModeAsync);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
xu_key_grab_keycode(Window win, int mask, int keycode)
|
|
||||||
{
|
|
||||||
XGrabKey(X_Dpy, keycode, mask, win, True, GrabModeAsync, GrabModeAsync);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -144,17 +134,6 @@ xu_getstate(struct client_ctx *cc, int *state)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
|
||||||
xu_getstrprop(struct client_ctx *cc, Atom atm)
|
|
||||||
{
|
|
||||||
u_char *cp;
|
|
||||||
|
|
||||||
if (xu_getprop(cc, atm, XA_STRING, 100L, &cp) <= 0)
|
|
||||||
return (NULL);
|
|
||||||
|
|
||||||
return ((char *)cp);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xu_setstate(struct client_ctx *cc, int state)
|
xu_setstate(struct client_ctx *cc, int state)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user