client: Add client_get_title and improve client_raise
This commit is contained in:
parent
4861329972
commit
3fbfbc08c3
15
src/client.c
15
src/client.c
@ -164,6 +164,16 @@ client_get(Window w)
|
||||
return c;
|
||||
}
|
||||
|
||||
void
|
||||
client_get_title(Client *c)
|
||||
{
|
||||
XFetchName(dpy, c->win, &(c->title));
|
||||
if(!c->title)
|
||||
c->title = strdup("WMFS");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
client_hide(Client *c)
|
||||
{
|
||||
@ -258,6 +268,8 @@ client_manage(Window w, XWindowAttributes *wa)
|
||||
else
|
||||
client_raise(c);
|
||||
|
||||
efree(t);
|
||||
|
||||
client_attach(c);
|
||||
XMoveResizeWindow(dpy, c->win, c->geo.x, c->geo.y, c->geo.width, c->geo.height);
|
||||
client_map(c);
|
||||
@ -415,8 +427,9 @@ client_size_hints(Client *c)
|
||||
void
|
||||
client_raise(Client *c)
|
||||
{
|
||||
if(!c)
|
||||
if(!c || !c->free)
|
||||
return;
|
||||
|
||||
XRaiseWindow(dpy, c->win);
|
||||
|
||||
if(conf.titlebar.exist)
|
||||
|
||||
@ -385,7 +385,7 @@ propertynotify(XEvent ev)
|
||||
}
|
||||
if(ev.xproperty.atom == XA_WM_NAME
|
||||
|| ev.xproperty.atom == net_atom[NetWMName])
|
||||
titlebar_update(c);
|
||||
client_get_title(c);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@ -96,9 +96,7 @@ titlebar_update(Client *c)
|
||||
{
|
||||
int pos_y, pos_x;
|
||||
|
||||
XFetchName(dpy, c->win, &(c->title));
|
||||
if(!c->title)
|
||||
c->title = strdup("WMFS");
|
||||
client_get_title(c);
|
||||
|
||||
if(!conf.titlebar.exist)
|
||||
return;
|
||||
|
||||
@ -84,6 +84,7 @@ void client_attach(Client *c);
|
||||
void client_detach(Client *c);
|
||||
void client_focus(Client *c);
|
||||
Client *client_get(Window w);
|
||||
void client_get_title(Client *c);
|
||||
void client_hide(Client *c);
|
||||
Bool ishide(Client *c);
|
||||
void client_map(Client *c);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user