jdjdjdj
This commit is contained in:
parent
d863af992b
commit
d5c9632edc
39
client.c
39
client.c
|
@ -95,7 +95,6 @@ static void
|
||||||
ban_client(Client *c)
|
ban_client(Client *c)
|
||||||
{
|
{
|
||||||
XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
|
XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
|
||||||
XMoveWindow(dpy, c->title, c->tx + 2 * sw, c->ty);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -191,23 +190,6 @@ ckill(Arg *arg)
|
||||||
XKillClient(dpy, sel->win);
|
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
|
void
|
||||||
update_name(Client *c)
|
update_name(Client *c)
|
||||||
{
|
{
|
||||||
|
@ -233,7 +215,6 @@ update_name(Client *c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XFree(name.value);
|
XFree(name.value);
|
||||||
resize_title(c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -278,13 +259,11 @@ void
|
||||||
craise(Client *c)
|
craise(Client *c)
|
||||||
{
|
{
|
||||||
XRaiseWindow(dpy, c->win);
|
XRaiseWindow(dpy, c->win);
|
||||||
XRaiseWindow(dpy, c->title);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lower(Client *c)
|
lower(Client *c)
|
||||||
{
|
{
|
||||||
XLowerWindow(dpy, c->title);
|
|
||||||
XLowerWindow(dpy, c->win);
|
XLowerWindow(dpy, c->win);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,11 +306,6 @@ manage(Window w, XWindowAttributes *wa)
|
||||||
twa.background_pixmap = ParentRelative;
|
twa.background_pixmap = ParentRelative;
|
||||||
twa.event_mask = ExposureMask;
|
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);
|
update_name(c);
|
||||||
|
|
||||||
for(l = &clients; *l; l = &(*l)->next);
|
for(l = &clients; *l; l = &(*l)->next);
|
||||||
|
@ -352,7 +326,6 @@ manage(Window w, XWindowAttributes *wa)
|
||||||
arrange(NULL);
|
arrange(NULL);
|
||||||
/* mapping the window now prevents flicker */
|
/* mapping the window now prevents flicker */
|
||||||
XMapRaised(dpy, c->win);
|
XMapRaised(dpy, c->win);
|
||||||
XMapRaised(dpy, c->title);
|
|
||||||
focus(c);
|
focus(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,7 +408,6 @@ resize(Client *c, Bool inc)
|
||||||
c->w = c->maxw;
|
c->w = c->maxw;
|
||||||
if(c->maxh && c->h > c->maxh)
|
if(c->maxh && c->h > c->maxh)
|
||||||
c->h = c->maxh;
|
c->h = c->maxh;
|
||||||
resize_title(c);
|
|
||||||
XSetWindowBorderWidth(dpy, c->win, 1);
|
XSetWindowBorderWidth(dpy, c->win, 1);
|
||||||
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
|
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
|
||||||
e.type = ConfigureNotify;
|
e.type = ConfigureNotify;
|
||||||
|
@ -467,7 +439,6 @@ unmanage(Client *c)
|
||||||
XSetErrorHandler(dummy_error_handler);
|
XSetErrorHandler(dummy_error_handler);
|
||||||
|
|
||||||
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
||||||
XDestroyWindow(dpy, c->title);
|
|
||||||
|
|
||||||
for(l = &clients; *l && *l != c; l = &(*l)->next);
|
for(l = &clients; *l && *l != c; l = &(*l)->next);
|
||||||
*l = c->next;
|
*l = c->next;
|
||||||
|
@ -487,15 +458,7 @@ unmanage(Client *c)
|
||||||
focus(sel);
|
focus(sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *
|
|
||||||
gettitle(Window w)
|
|
||||||
{
|
|
||||||
Client *c;
|
|
||||||
for(c = clients; c; c = c->next)
|
|
||||||
if(c->title == w)
|
|
||||||
return c;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
Client *
|
Client *
|
||||||
getclient(Window w)
|
getclient(Window w)
|
||||||
|
|
Loading…
Reference in New Issue