} color_t;
/* Global data */
-static void *win_cache;
+static void *cache;
static Atom atoms[natoms];
static int (*xerrorxlib)(Display *, XErrorEvent *);
static unsigned long colors[ncolors];
win_sys_t sys = {.dpy=dpy, .xid=xid};
win_t tmp = {.sys=&sys};
win_t **old = NULL, *new = NULL;
- if ((old = tfind(&tmp, &win_cache, win_cmp)))
+ if ((old = tfind(&tmp, &cache, win_cmp)))
return *old;
if (create && (new = win_new(dpy,xid)))
- tsearch(new, &win_cache, win_cmp);
+ tsearch(new, &cache, win_cmp);
return new;
}
static void win_remove(win_t *win)
{
- tdelete(win, &win_cache, win_cmp);
+ tdelete(win, &cache, win_cmp);
free(win->sys);
free(win);
}
{
//printf("sys_move: %p - %d,%d %dx%d\n", win, x, y, w, h);
int b = 2*BORDER;
- win->x = MAX(x,0); win->y = MAX(y,0);
+ win->x = x; win->y = y;
win->w = MAX(w,1+b); win->h = MAX(h,1+b);
w = MAX(w-b,1); h = MAX(h-b,1);
XMoveResizeWindow(win->sys->dpy, win->sys->xid, x, y, w, h);