int x11_init(XConf* x);
void x11_error_clear(void);
XErrorEvent* x11_error_get(void);
+void x11_resize(XConf* x, XEvent* e);
void x11_mkwin(XConf* x, int width, int height, int evmask);
void x11_mkdialog(XConf* x, int width, int height, int evmask);
if (bything == buf_byline)
buf_setcol(BUF);
if (!extsel)
- buf_selclr(BUF, RIGHT);
+ buf_selclr(BUF, (move < 0 ? LEFT : RIGHT));
/* only update column if not moving vertically */
if (bything != buf_byline)
buf_getcol(BUF);
(e->type == FocusIn ? XSetICFocus : XUnsetICFocus)(x->xic);
}
-static void xresize(XConf* x, XEvent* e) {
+void x11_resize(XConf* x, XEvent* e) {
if (e->xconfigure.width != x->width || e->xconfigure.height != x->height) {
x->width = e->xconfigure.width;
x->height = e->xconfigure.height;
x->gc = XCreateGC(x->display, x->self, GCGraphicsExposures, &gcv);
x->eventfns[FocusIn] = xfocus;
x->eventfns[FocusOut] = xfocus;
- x->eventfns[ConfigureNotify] = xresize;
+ x->eventfns[ConfigureNotify] = x11_resize;
}
void x11_centerwin(XConf* x) {
XNextEvent(x->display, &ev);
if (XFilterEvent(&ev, None))
continue;
- xresize(x, &ev);
+ x11_resize(x, &ev);
} while (ev.type != MapNotify);
XWarpPointer(x->display, None, x->self, 0, 0, x->width, x->height, x->width/2, x->height/2);
}
static void xconfigure(XConf* x, XEvent* e) {
if (e->xconfigure.window != x->self) return;
+ x11_resize(x, e);
if (e->xconfigure.width != x->width || e->xconfigure.height != x->height) {
- x->width = e->xconfigure.width;
- x->height = e->xconfigure.height;
- x->pixmap = XCreatePixmap(x->display, x->self, x->width, x->height, x->depth);
- x->xft = XftDrawCreate(x->display, x->pixmap, x->visual, x->colormap);
retile = 1;
}
}