/* Utility Functions
*****************************************************************************/
void dbg(char* fmt, ...) {
- static FILE* dbgf = NULL;
- if (!dbgf) { dbgf = fopen("w", "~/.anvil.log"); }
va_list args;
va_start(args, fmt);
- vfprintf(dbgf, fmt, args);
- fflush(dbgf);
+ vfprintf(stderr, fmt, args);
va_end(args);
}
x->display, x->root, 0, 0, 1, 1, 0,
x->depth, CopyFromParent, x->visual,
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWEventMask, &pattr);
- XSelectInput(x->display, c->win, PropertyChangeMask);
+ c->xft = XftDrawCreate(x->display, (Drawable) c->frame, x->visual, x->colormap);
+// XSetWindowBorderWidth(x->display, c->frame, 1);
+// XSetWindowBorderWidth(x->display, c->win, 1);
+ XSelectInput(x->display, c->frame,
+ ButtonPressMask|ButtonReleaseMask|FocusChangeMask|StructureNotifyMask);
+ XSelectInput(x->display, c->win,
+ EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
#if 0
XSetWindowBorderWidth(x->display, c->win, 0);
XMoveResizeWindow(x->display, c->frame, 100, 100 - x->font->height, c->w, x->font->height);
XMoveResizeWindow(x->display, c->win, 100, 100, c->w, c->h);
client_config(x, c);
- XMapWindow(x->display, c->frame);
+ XMapRaised(x->display, c->frame);
XMapRaised(x->display, c->win);
#endif
}
Client* client_del(XConf* x, Client* curr, Client* c) {
- dbg("%p == %p\n", curr, c);
if (!curr) {
return NULL;
} else if (curr == c) {
- dbg("destroy\n", curr, c);
Client* next = c->next;
XGrabServer(x->display);
client_setstate(x, c, WithdrawnState);
#pragma GCC diagnostic ignored "-Wunused-parameter"
static void xbtnpress(XConf* x, XEvent* e) {
+ dbg("btn\n");
}
static void xconfigrequest(XConf* x, XEvent* e) {
}
static void xdestroynotify(XConf* x, XEvent* e) {
+ dbg("destroy\n");
+ Client* c = client_find(e->xdestroywindow.window);
+ if (c) Clients = client_del(x, Clients, c);
}
static void xclientmsg(XConf* x, XEvent* e) {
+ dbg("client\n");
}
static void xpropnotify(XConf* x, XEvent* e) {
+ dbg("prop\n");
}
static void xenternotify(XConf* x, XEvent* e) {
+ dbg("enter\n");
}
static void xexpose(XConf* x, XEvent* e) {
+ dbg("expose\n");
}
#pragma GCC diagnostic pop