client: remove _AWESOME_TAGS property

We use EWMH hints.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-02-26 12:40:24 +01:00
parent cc2b8f4e89
commit 17e2d9e58f
5 changed files with 2 additions and 75 deletions

View File

@ -146,20 +146,15 @@ scan(void)
for(i = 0; i < tree_c_len; i++)
{
bool has_awesome_prop;
attr_r = xcb_get_window_attributes_reply(globalconf.connection,
attr_wins[i],
NULL);
state = window_state_get_reply(state_wins[i]);
has_awesome_prop = xutil_text_prop_get(globalconf.connection, wins[i],
_AWESOME_TAGS, NULL, NULL);
if(!attr_r || attr_r->override_redirect
|| (attr_r->map_state != XCB_MAP_STATE_VIEWABLE && !has_awesome_prop)
|| (state == XCB_WM_STATE_WITHDRAWN && !has_awesome_prop))
|| attr_r->map_state != XCB_MAP_STATE_VIEWABLE
|| state == XCB_WM_STATE_WITHDRAWN)
{
geom_wins[i] = NULL;
p_delete(&attr_r);

View File

@ -40,38 +40,6 @@ DO_LUA_NEW(extern, client_t, client, "client", client_ref)
DO_LUA_EQ(client_t, client, "client")
DO_LUA_GC(client_t, client, "client", client_unref)
/** Load windows properties, restoring client's tag
* and floating state before awesome was restarted if any.
* \param c A client pointer.
* \param screen A virtual screen.
* \return True if client had property, false otherwise.
*/
static bool
client_loadprops(client_t * c, screen_t *screen)
{
ssize_t len;
tag_array_t *tags = &screen->tags;
char *prop = NULL;
if(!xutil_text_prop_get(globalconf.connection, c->win, _AWESOME_TAGS,
&prop, &len))
return false;
/* ignore property if the tag count isn't matching */
if(len == tags->len)
for(int i = 0; i < tags->len; i++)
{
if(prop[i] == '1')
tag_client(c, tags->tab[i]);
else
untag_client(c, tags->tab[i]);
}
p_delete(&prop);
return true;
}
/** Check if client supports protocol a protocole in WM_PROTOCOL.
* \param win The window.
* \return True if client has the atom in protocol, false otherwise.
@ -592,9 +560,6 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int phys_screen,
if(tc != c && tc->phys_screen == c->phys_screen)
screen = tc->screen;
/* Try to load props */
client_loadprops(c, &globalconf.screens[screen]);
/* Then check clients hints */
ewmh_client_check_hints(c);
@ -1074,22 +1039,6 @@ client_setontop(client_t *c, bool s)
}
}
/** Save client properties as an X property.
* \param c The client.
*/
void
client_saveprops_tags(client_t *c)
{
tag_array_t *tags = &globalconf.screens[c->screen].tags;
unsigned char *prop = p_alloca(unsigned char, tags->len + 1);
int i;
for(i = 0; i < tags->len; i++)
prop[i] = is_client_tagged(c, tags->tab[i]) ? '1' : '0';
xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, c->win, _AWESOME_TAGS, STRING, 8, i, prop);
}
/** Unban a client and move it back into the viewport.
* \param c The client.
*/
@ -1182,9 +1131,6 @@ client_unmanage(client_t *c)
ewmh_update_net_client_list(c->phys_screen);
/* delete properties */
xcb_delete_property(globalconf.connection, c->win, _AWESOME_TAGS);
/* All the wiboxes (may) need to be repositioned. */
if(client_hasstrut(c))
wibox_update_positions();

View File

@ -54,7 +54,6 @@ void client_manage(xcb_window_t, xcb_get_geometry_reply_t *, int, bool);
area_t client_geometry_hints(client_t *, area_t);
bool client_resize(client_t *, area_t, bool);
void client_unmanage(client_t *);
void client_saveprops_tags(client_t *);
void client_kill(client_t *);
void client_setsticky(client_t *, bool);
void client_setabove(client_t *, bool);

View File

@ -45,7 +45,6 @@ _NET_WM_STATE_HIDDEN
_NET_WM_STATE_DEMANDS_ATTENTION
UTF8_STRING
COMPOUND_TEXT
_AWESOME_TAGS
WM_PROTOCOLS
WM_DELETE_WINDOW
_XEMBED

12
tag.c
View File

@ -77,11 +77,6 @@ tag_append_to_screen(tag_t *tag, screen_t *s)
ewmh_update_net_desktop_names(phys_screen);
ewmh_update_workarea(phys_screen);
/* resave tag prop of all clients so the number of tag will be the
* same */
for(client_t *c = globalconf.clients; c; c = c->next)
client_saveprops_tags(c);
/* call hook */
if(globalconf.hooks.tags != LUA_REFNIL)
{
@ -113,11 +108,6 @@ tag_remove_from_screen(tag_t *tag)
ewmh_update_workarea(phys_screen);
tag->screen = SCREEN_UNDEF;
/* resave tag prop of all clients so the number of tag will be the
* same */
for(client_t *c = globalconf.clients; c; c = c->next)
client_saveprops_tags(c);
/* call hook */
if(globalconf.hooks.tags != LUA_REFNIL)
{
@ -143,7 +133,6 @@ tag_client(client_t *c, tag_t *t)
tag_ref(&t);
client_array_append(&t->clients, c);
client_saveprops_tags(c);
ewmh_client_update_desktop(c);
client_need_arrange(c);
/* call hook */
@ -167,7 +156,6 @@ untag_client(client_t *c, tag_t *t)
{
client_need_arrange(c);
client_array_take(&t->clients, i);
client_saveprops_tags(c);
ewmh_client_update_desktop(c);
/* call hook */
if(globalconf.hooks.tagged != LUA_REFNIL)