remove Nscreens and x_screenname() - we really don't need them.

ok oga@
This commit is contained in:
okan 2009-01-27 02:16:20 +00:00
parent c750462d13
commit 6ad198022b
2 changed files with 1 additions and 34 deletions

View File

@ -31,7 +31,6 @@ Cursor Cursor_question;
struct screen_ctx_q Screenq; struct screen_ctx_q Screenq;
struct screen_ctx *Curscreen; struct screen_ctx *Curscreen;
u_int Nscreens;
struct client_ctx_q Clientq; struct client_ctx_q Clientq;
@ -124,8 +123,7 @@ x_setup(void)
struct keybinding *kb; struct keybinding *kb;
int i; int i;
Nscreens = ScreenCount(X_Dpy); for (i = 0; i < ScreenCount(X_Dpy); i++) {
for (i = 0; i < (int)Nscreens; i++) {
XCALLOC(sc, struct screen_ctx); XCALLOC(sc, struct screen_ctx);
x_setupscreen(sc, i); x_setupscreen(sc, i);
TAILQ_INSERT_TAIL(&Screenq, sc, entry); TAILQ_INSERT_TAIL(&Screenq, sc, entry);
@ -138,7 +136,6 @@ x_setup(void)
TAILQ_FOREACH(kb, &Conf.keybindingq, entry) TAILQ_FOREACH(kb, &Conf.keybindingq, entry)
conf_grab(&Conf, kb); conf_grab(&Conf, kb);
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);
Cursor_select = XCreateFontCursor(X_Dpy, XC_hand1); Cursor_select = XCreateFontCursor(X_Dpy, XC_hand1);
@ -159,7 +156,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
Curscreen = sc; Curscreen = sc;
sc->display = x_screenname(which);
sc->which = which; sc->which = which;
sc->rootwin = RootWindow(X_Dpy, which); sc->rootwin = RootWindow(X_Dpy, which);
@ -242,32 +238,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
return; return;
} }
char *
x_screenname(int which)
{
char *cp, *dstr, *sn;
size_t snlen;
if (which > 9)
errx(1, "Can't handle more than 9 screens. If you need it, "
"tell <marius@monkey.org>. It's a trivial fix.");
dstr = xstrdup(DisplayString(X_Dpy));
if ((cp = strrchr(dstr, ':')) == NULL)
return (NULL);
if ((cp = strchr(cp, '.')) != NULL)
*cp = '\0';
snlen = strlen(dstr) + 3; /* string, dot, number, null */
sn = (char *)xmalloc(snlen);
snprintf(sn, snlen, "%s.%d", dstr, which);
free(dstr);
return (sn);
}
int int
x_errorhandler(Display *dpy, XErrorEvent *e) x_errorhandler(Display *dpy, XErrorEvent *e)
{ {

View File

@ -47,7 +47,6 @@ struct screen_ctx {
Colormap colormap; Colormap colormap;
XColor bgcolor, fgcolor, fccolor, redcolor, graycolor, XColor bgcolor, fgcolor, fccolor, redcolor, graycolor,
whitecolor, blackcolor; whitecolor, blackcolor;
char *display;
unsigned long blackpixl, whitepixl, redpixl, bluepixl, graypixl; unsigned long blackpixl, whitepixl, redpixl, bluepixl, graypixl;
GC gc; GC gc;
@ -310,7 +309,6 @@ int input_keycodetrans(KeyCode, u_int, enum ctltype *,
int x_errorhandler(Display *, XErrorEvent *); int x_errorhandler(Display *, XErrorEvent *);
void x_setup(void); void x_setup(void);
char *x_screenname(int);
void x_setupscreen(struct screen_ctx *, u_int); void x_setupscreen(struct screen_ctx *, u_int);
__dead void usage(void); __dead void usage(void);
@ -512,7 +510,6 @@ extern Cursor Cursor_question;
extern struct screen_ctx_q Screenq; extern struct screen_ctx_q Screenq;
extern struct screen_ctx *curscreen; extern struct screen_ctx *curscreen;
extern u_int Nscreens;
extern struct client_ctx_q Clientq; extern struct client_ctx_q Clientq;