summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2006-10-12 09:23:56 +0000
committerRich Felker <dalias@aerifal.cx>2006-10-12 09:23:56 +0000
commit7ca32f10ec29cf7b527021cd12573fd2bb63c2ee (patch)
tree0ce8e8d41baaf3ae0076a149c9f49c64714d89b6
parent0e307e9611126069e1c81a686d1ba4024ff81826 (diff)
downloaduuterm-7ca32f10ec29cf7b527021cd12573fd2bb63c2ee.tar.gz
1% less messy/hackish
-rw-r--r--xlib.c13
1 files changed, 7 insertions, 6 deletions
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);