On Tue, Oct 04, 2011 at 10:19:34AM +0200, Uli Schlachter wrote: > On 04.10.2011 07:32, David Palacio wrote: > > On Sun, Oct 02, 2011 at 02:11:18PM -0500, David Palacio wrote: > >> I am using Awesome as the window manager for my KDE desktop. I would like > >> to > >> set different desktops per Awesome tag. I use client:tags({tags}) to set on > >> which tags should the desktop be visible. But that does not work as > >> expected as > >> the desktops are still visible in all tags. Is there a way to make a > >> window of > >> type desktop visible only on certain tags? > > > > I patched Awesome to let desktop windows be visible on certain tags. > > What are your thoughts on these changes? > > > Description: Taggable desktops > > This patch allows windows of type Desktop to be visible only on certain > > tags. > > This works by removing the assumption that desktop windows are always > > visible > > (see diff in client.c). > > Ok. I checked EWMH and I have no clue why awesome was doing this. This code > was > added to awesome in commit 427679b0 which is the commit when support for > _NET_WM_WINDOW_TYPE was added. > > > Other changes include: > > * Returning an empty table of tabs when querying the tabs function. > > (see second diff in client.c) > > * Returning a table of clients excluding the desktop client when querying > > the > > tag clients. > > (see diff in tag.c) > > Uhm, why? Desktop clients can be tagged, so why should they be hidden from > tags? Because the taglist widget will show "with clients focused/unfocused" state if it has an unstickied desktop client.
I do not like the client object lying about the tags it is tagged on so I removed the change on client.c and instead patched taglist.lua to ignore desktop clients. I kept the change on tag.c to keep the changes on taglist.lua simple. Also, because tag.clients did not return desktop clients before these patches either. > Also, please send a git formatted patch so that you are tracked as the patch's > author. Thanks a lot! Attached. > > Uli Thanks!
>From 4b8c2a09de66c8b88d66247ba6b5266d9794bb75 Mon Sep 17 00:00:00 2001 From: David Palacio <dpala...@orbitalibre.org> Date: Tue, 4 Oct 2011 10:22:43 -0500 Subject: [PATCH 1/2] Desktop clients may not be visible on all tags. Usually desktop clients are on a sticky state. If the client is not sticky, only show on selected tags. --- client.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/client.c b/client.c index 049e3d5..7bb5b81 100644 --- a/client.c +++ b/client.c @@ -244,7 +244,7 @@ client_maybevisible(client_t *c, screen_t *screen) { if(screen && c->screen == screen) { - if(c->sticky || c->type == WINDOW_TYPE_DESKTOP) + if(c->sticky) return true; foreach(tag, screen->tags) -- 1.7.6.3
>From b26fb6f2d2689fcd01988cbf35f2ae7df8723697 Mon Sep 17 00:00:00 2001 From: David Palacio <dpala...@orbitalibre.org> Date: Tue, 4 Oct 2011 10:30:28 -0500 Subject: [PATCH 2/2] Ignore desktop clients on taglist widget Make the taglist widget skip unstickied and focused desktop clients for status update by: * Ignoring focused client if it is of desktop type * Returning a list of clients from tag.clients without clients of desktop type. --- lib/awful/widget/taglist.lua.in | 2 +- tag.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/lib/awful/widget/taglist.lua.in b/lib/awful/widget/taglist.lua.in index b3aceb4..5cafa29 100644 --- a/lib/awful/widget/taglist.lua.in +++ b/lib/awful/widget/taglist.lua.in @@ -128,7 +128,7 @@ function label.all(t, args) bg_color = bg_focus fg_color = fg_focus end - if sel then + if sel and sel.type ~= "desktop" then if taglist_squares_sel then -- Check that the selected clients is tagged with 't'. local seltags = sel:tags() diff --git a/tag.c b/tag.c index e8a98f9..ad8aca4 100644 --- a/tag.c +++ b/tag.c @@ -397,6 +397,8 @@ luaA_tag_clients(lua_State *L) lua_createtable(L, clients->len, 0); for(i = 0; i < clients->len; i++) { + if(clients->tab[i]->type == WINDOW_TYPE_DESKTOP) + continue; luaA_object_push(L, clients->tab[i]); lua_rawseti(L, -2, i + 1); } -- 1.7.6.3