summary refs log tree commit diff
path: root/calmwm.c
diff options
context:
space:
mode:
authorokan <okan>2009-01-27 02:16:20 +0000
committerokan <okan>2009-01-27 02:16:20 +0000
commit6ad198022b7ccdcaba091827d6cef3be27bb8d87 (patch)
tree22997cc93927d193f1bcbc0b58d313b1ddab3154 /calmwm.c
parentc750462d13e2ee289d715bca58a85123d6f055f5 (diff)
downloadcwm-6ad198022b7ccdcaba091827d6cef3be27bb8d87.tar.gz
cwm-6ad198022b7ccdcaba091827d6cef3be27bb8d87.tar.xz
cwm-6ad198022b7ccdcaba091827d6cef3be27bb8d87.zip
remove Nscreens and x_screenname() - we really don't need them.
ok oga@
Diffstat (limited to 'calmwm.c')
-rw-r--r--calmwm.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/calmwm.c b/calmwm.c
index 6dc7cb2..843db62 100644
--- a/calmwm.c
+++ b/calmwm.c
@@ -31,7 +31,6 @@ Cursor				 Cursor_question;
 
 struct screen_ctx_q		 Screenq;
 struct screen_ctx		*Curscreen;
-u_int				 Nscreens;
 
 struct client_ctx_q		 Clientq;
 
@@ -124,8 +123,7 @@ x_setup(void)
 	struct keybinding	*kb;
 	int			 i;
 
-	Nscreens = ScreenCount(X_Dpy);
-	for (i = 0; i < (int)Nscreens; i++) {
+	for (i = 0; i < ScreenCount(X_Dpy); i++) {
 		XCALLOC(sc, struct screen_ctx);
 		x_setupscreen(sc, i);
 		TAILQ_INSERT_TAIL(&Screenq, sc, entry);
@@ -138,7 +136,6 @@ x_setup(void)
 	TAILQ_FOREACH(kb, &Conf.keybindingq, entry)
 		conf_grab(&Conf, kb);
 
-
 	Cursor_move = XCreateFontCursor(X_Dpy, XC_fleur);
 	Cursor_resize = XCreateFontCursor(X_Dpy, XC_bottom_right_corner);
 	Cursor_select = XCreateFontCursor(X_Dpy, XC_hand1);
@@ -159,7 +156,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
 
 	Curscreen = sc;
 
-	sc->display = x_screenname(which);
 	sc->which = which;
 	sc->rootwin = RootWindow(X_Dpy, which);
 
@@ -242,32 +238,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
 	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
 x_errorhandler(Display *dpy, XErrorEvent *e)
 {