diff --git a/src/client.c b/src/client.c index 3ca677e..90e2eed 100644 --- a/src/client.c +++ b/src/client.c @@ -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 */ diff --git a/src/mouse.c b/src/mouse.c index 2083d1e..9cf86e9 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -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); diff --git a/src/tag.c b/src/tag.c index fd0dce7..f135ae9 100644 --- a/src/tag.c +++ b/src/tag.c @@ -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; } diff --git a/src/wmfs.h b/src/wmfs.h index 6785ec8..c417945 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -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);