From 7ca32f10ec29cf7b527021cd12573fd2bb63c2ee Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 12 Oct 2006 09:23:56 +0000 Subject: 1% less messy/hackish --- xlib.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'xlib.c') diff --git a/xlib.c b/xlib.c index bb22e3e..1f24881 100644 --- a/xlib.c +++ b/xlib.c @@ -71,8 +71,7 @@ int uudisp_open(struct uudisp *d) XGCValues values; XVisualInfo vi; char *s; - int px_w = 80*d->cell_w; - int px_h = 24*d->cell_h; + int px_w, px_h; struct ucf *f = d->font; const unsigned char *glyphs, *end; int nglyphs = f->nglyphs; @@ -84,6 +83,12 @@ int uudisp_open(struct uudisp *d) if (!(p->display = XOpenDisplay(NULL))) return -1; + d->w = 80; + d->h = 24; + p->slices_y = uuterm_alloc(d->h*sizeof(int)); + px_w = d->w*d->cell_w; + px_h = d->h*d->cell_h; + p->fd = ConnectionNumber(p->display); p->screen = DefaultScreen(p->display); p->window = XCreateSimpleWindow(p->display, @@ -94,10 +99,6 @@ int uudisp_open(struct uudisp *d) XSelectInput(p->display, p->window, KeyPressMask|ExposureMask); XMapWindow(p->display, p->window); - d->w = 80; - d->h = 24; - p->slices_y = uuterm_alloc(240*sizeof(int)); - //XSetLocaleModifiers("@im=none"); //p->im = XOpenIM(p->display, 0, 0, 0); //p->ic = XCreateIC(p->im, XNInputStyle, XIMPreeditNothing|XIMStatusNothing); -- cgit v1.2.3