summaryrefslogtreecommitdiff
path: root/xlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlib.c')
-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);