Client: Add client attributes _WMFS_TAG and _WMFS_SCREEN

This commit is contained in:
Martin Duquesnoy
2009-04-23 16:33:15 +02:00
parent 70e8238a52
commit 2ae33ef544
4 changed files with 23 additions and 2 deletions

View File

@@ -478,6 +478,7 @@ client_manage(Window w, XWindowAttributes *wa)
ewmh_manage_window_type(c);
arrange(c->screen);
client_set_wanted_tag(c);
client_update_attributes(c);
return;
}
@@ -555,6 +556,7 @@ client_moveresize(Client *c, XRectangle geo, Bool r)
c->geo.height);
client_configure(c);
client_update_attributes(c);
return;
}
@@ -685,6 +687,21 @@ client_set_wanted_tag(Client *c)
return;
}
/** Update client attributes (_WMFS_TAG _WMFS_SCREEN)
*\param c Client pointer
*/
void
client_update_attributes(Client *c)
{
XChangeProperty(dpy, c->win, ATOM("_WMFS_TAG"), XA_CARDINAL, 32,
PropModeReplace, (uchar*)&(c->tag), 1);
XChangeProperty(dpy, c->win, ATOM("_WMFS_SCREEN"), XA_CARDINAL, 32,
PropModeReplace, (uchar*)&(c->screen), 1);
return;
}
/** Raise a client
* \param c Client pointer
*/

View File

@@ -109,6 +109,7 @@ mouse_move(Client *c)
}
while(ev.type != ButtonRelease);
client_update_attributes(c);
XUngrabPointer(dpy, CurrentTime);
return;
@@ -138,7 +139,7 @@ mouse_resize(Client *c)
return;
do
{
XMaskEvent(dpy, MouseMask | SubstructureRedirectMask, &ev);
XMaskEvent(dpy, MouseMask | ExposureMask | SubstructureRedirectMask, &ev);
if(ev.type == MotionNotify)
{
@@ -185,6 +186,7 @@ mouse_resize(Client *c)
else
tags[selscreen][seltag[selscreen]].layout.func(c->screen);
client_update_attributes(c);
XUngrabPointer(dpy, CurrentTime);

View File

@@ -79,7 +79,6 @@ tag_set(int tag)
client_focus((c) ? c : NULL);
return;
}
@@ -105,6 +104,8 @@ tag_transfert(Client *c, int tag)
if(c == sel)
client_focus(NULL);
client_update_attributes(c);
return;
}

View File

@@ -150,6 +150,7 @@ void client_unhide(Client *c);
void client_unmanage(Client *c);
void client_unmap(Client *c);
void client_set_wanted_tag(Client *c);
void client_update_attributes(Client *c);
void uicb_client_raise(uicb_t);
void uicb_client_prev(uicb_t);
void uicb_client_next(uicb_t);