[uicb] uicb_client_toggletag() with NULL use as sticky toggle
The following modification to client_toggletag will make it possible to make windows sticky/unsticky via client_toggletag(0). Upon unsticky, the window will stay at the currently selected tags. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
2a6292db29
commit
981c47835e
16
tag.c
16
tag.c
|
@ -226,8 +226,8 @@ uicb_client_tag(int screen, char *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Toggle a tag on client
|
/** Toggle a tag on client
|
||||||
* \param screen Screen ID
|
* \param screen virtual screen id
|
||||||
* \param arg Tag name
|
* \param arg tag number
|
||||||
* \ingroup ui_callback
|
* \ingroup ui_callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
@ -235,6 +235,7 @@ uicb_client_toggletag(int screen, char *arg)
|
||||||
{
|
{
|
||||||
Client *sel = globalconf.focus->client;
|
Client *sel = globalconf.focus->client;
|
||||||
int i;
|
int i;
|
||||||
|
Bool is_sticky = True;
|
||||||
Tag *tag, *target_tag;
|
Tag *tag, *target_tag;
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
|
@ -261,11 +262,16 @@ uicb_client_toggletag(int screen, char *arg)
|
||||||
tag_client(sel, target_tag);
|
tag_client(sel, target_tag);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
for(tag = globalconf.screens[screen].tags; tag; tag = tag->next)
|
for(tag = globalconf.screens[screen].tags; tag; tag = tag->next)
|
||||||
if(is_client_tagged(sel, tag))
|
if(!is_client_tagged(sel, tag))
|
||||||
|
{
|
||||||
|
is_sticky = False;
|
||||||
tag_client(sel, tag);
|
tag_client(sel, tag);
|
||||||
else
|
}
|
||||||
untag_client(sel, tag);
|
if(is_sticky)
|
||||||
|
tag_client_with_current_selected(sel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Add a tag to viewed tags
|
/** Add a tag to viewed tags
|
||||||
|
|
Loading…
Reference in New Issue