aboutsummaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorokan2014-02-02 16:29:04 +0000
committerokan2014-02-02 16:29:04 +0000
commitb803e99634ca48acb240a6e5a67ab768a72159bc (patch)
treee14c9365928aec3a36165f787cf763744738dbcb /conf.c
parent7cf90fa84564259d6ef67cd63017a6cdec385f5a (diff)
downloadcwm-b803e99634ca48acb240a6e5a67ab768a72159bc.tar.gz
No need to store screen colormap and visual; rather just use the X
macros in the one place they are needed.
Diffstat (limited to '')
-rw-r--r--conf.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/conf.c b/conf.c
index fb50ed7..c974f97 100644
--- a/conf.c
+++ b/conf.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: conf.c,v 1.171 2014/02/02 15:46:05 okan Exp $
+ * $OpenBSD: conf.c,v 1.172 2014/02/02 16:29:04 okan Exp $
*/
#include <sys/param.h>
@@ -125,6 +125,8 @@ conf_screen(struct screen_ctx *sc)
{
unsigned int i;
XftColor xc;
+ Colormap colormap = DefaultColormap(X_Dpy, sc->which);
+ Visual *visual = DefaultVisual(X_Dpy, sc->which);
sc->gap = Conf.gap;
sc->snapdist = Conf.snapdist;
@@ -141,18 +143,18 @@ conf_screen(struct screen_ctx *sc)
xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_BG],
sc->xftcolor[CWM_COLOR_MENU_FG], &xc);
xu_xorcolor(sc->xftcolor[CWM_COLOR_MENU_FONT], xc, &xc);
- if (!XftColorAllocValue(X_Dpy, sc->visual, sc->colormap,
+ if (!XftColorAllocValue(X_Dpy, visual, colormap,
&xc.color, &sc->xftcolor[CWM_COLOR_MENU_FONT_SEL]))
warnx("XftColorAllocValue: %s", Conf.color[i]);
break;
}
- if (XftColorAllocName(X_Dpy, sc->visual, sc->colormap,
+ if (XftColorAllocName(X_Dpy, visual, colormap,
Conf.color[i], &xc)) {
sc->xftcolor[i] = xc;
- XftColorFree(X_Dpy, sc->visual, sc->colormap, &xc);
+ XftColorFree(X_Dpy, visual, colormap, &xc);
} else {
warnx("XftColorAllocName: %s", Conf.color[i]);
- XftColorAllocName(X_Dpy, sc->visual, sc->colormap,
+ XftColorAllocName(X_Dpy, visual, colormap,
color_binds[i], &sc->xftcolor[i]);
}
}
@@ -162,8 +164,7 @@ conf_screen(struct screen_ctx *sc)
sc->xftcolor[CWM_COLOR_MENU_FG].pixel,
sc->xftcolor[CWM_COLOR_MENU_BG].pixel);
- sc->xftdraw = XftDrawCreate(X_Dpy, sc->menuwin,
- sc->visual, sc->colormap);
+ sc->xftdraw = XftDrawCreate(X_Dpy, sc->menuwin, visual, colormap);
if (sc->xftdraw == NULL)
errx(1, "XftDrawCreate");