This commit is contained in:
exkc 2022-07-20 16:41:27 +08:00
parent d863af992b
commit d5c9632edc
3 changed files with 1 additions and 38 deletions

View File

@ -95,7 +95,6 @@ static void
ban_client(Client *c)
{
XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
XMoveWindow(dpy, c->title, c->tx + 2 * sw, c->ty);
}
void
@ -191,23 +190,6 @@ ckill(Arg *arg)
XKillClient(dpy, sel->win);
}
static void
resize_title(Client *c)
{
int i;
c->tw = 0;
for(i = 0; i < TLast; i++)
if(c->tags[i])
c->tw += dc.font.height;
c->tw += textw(c->name) + dc.font.height;
if(c->tw > c->w)
c->tw = c->w + 2;
c->tx = c->x + c->w - c->tw + 2;
c->ty = c->y;
XMoveResizeWindow(dpy, c->title, c->tx, c->ty, c->tw, c->th);
}
void
update_name(Client *c)
{
@ -233,7 +215,6 @@ update_name(Client *c)
}
}
XFree(name.value);
resize_title(c);
}
void
@ -278,13 +259,11 @@ void
craise(Client *c)
{
XRaiseWindow(dpy, c->win);
XRaiseWindow(dpy, c->title);
}
void
lower(Client *c)
{
XLowerWindow(dpy, c->title);
XLowerWindow(dpy, c->win);
}
@ -327,11 +306,6 @@ manage(Window w, XWindowAttributes *wa)
twa.background_pixmap = ParentRelative;
twa.event_mask = ExposureMask;
c->title = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th,
0, DefaultDepth(dpy, screen), CopyFromParent,
DefaultVisual(dpy, screen),
CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
update_name(c);
for(l = &clients; *l; l = &(*l)->next);
@ -352,7 +326,6 @@ manage(Window w, XWindowAttributes *wa)
arrange(NULL);
/* mapping the window now prevents flicker */
XMapRaised(dpy, c->win);
XMapRaised(dpy, c->title);
focus(c);
}
@ -435,7 +408,6 @@ resize(Client *c, Bool inc)
c->w = c->maxw;
if(c->maxh && c->h > c->maxh)
c->h = c->maxh;
resize_title(c);
XSetWindowBorderWidth(dpy, c->win, 1);
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
e.type = ConfigureNotify;
@ -467,7 +439,6 @@ unmanage(Client *c)
XSetErrorHandler(dummy_error_handler);
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
XDestroyWindow(dpy, c->title);
for(l = &clients; *l && *l != c; l = &(*l)->next);
*l = c->next;
@ -487,15 +458,7 @@ unmanage(Client *c)
focus(sel);
}
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)

BIN
client.o

Binary file not shown.

BIN
dumbwm

Binary file not shown.