some more additions/fixes
Anselm R. Garbe garbeam@wmii.de
Wed, 12 Jul 2006 00:00:25 +0200
M
client.c
→
client.c
@@ -93,6 +93,7 @@ draw_client(old);
} XUnmapWindow(dpy, c->title); draw_bar(); + discard_events(EnterWindowMask); XFlush(dpy); }@@ -116,7 +117,7 @@ XSelectInput(dpy, c->win, CLIENT_MASK);
XGetTransientForHint(dpy, c->win, &c->trans); twa.override_redirect = 1; twa.background_pixmap = ParentRelative; - twa.event_mask = SubstructureNotifyMask | ExposureMask; + twa.event_mask = ExposureMask; c->title = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th, 0, DefaultDepth(dpy, screen), CopyFromParent,@@ -191,11 +192,19 @@
XFlush(dpy); XSetErrorHandler(error_handler); XUngrabServer(dpy); - discard_events(EnterWindowMask); if(stack) focus(stack); } +Client * +gettitle(Window w) +{ + Client *c; + for(c = clients; c; c = c->next) + if(c->title == w) + return c; + return NULL; +} Client * getclient(Window w)
M
cmd.c
→
cmd.c
@@ -20,6 +20,22 @@ running = False;
} void +sel(void *aux) +{ + const char *arg = aux; + Client *c; + + if(!arg || !stack) + return; + if(!strncmp(arg, "next", 5)) + focus(stack->snext ? stack->snext : stack); + else if(!strncmp(arg, "prev", 5)) { + for(c = stack; c && c->snext; c = c->snext); + focus(c ? c : stack); + } +} + +void kill(void *aux) { Client *c = stack;
M
wm.h
→
wm.h
@@ -63,6 +63,7 @@ /* cmd.c */
extern void run(void *aux); extern void quit(void *aux); extern void kill(void *aux); +extern void sel(void *aux); /* client.c */ extern void manage(Window w, XWindowAttributes *wa);@@ -73,6 +74,7 @@ extern void update_name(Client *c);
extern void draw_client(Client *c); extern void resize(Client *c); extern void update_size(Client *c); +extern Client *gettitle(Window w); /* event.c */ extern unsigned int discard_events(long even_mask);