Add client_set_master command

The function swaps selected client with the first one (master).
This commit is contained in:
Viet Nguyen Quoc 2011-03-20 11:31:31 +07:00 committed by Raphael Khaiat
parent a7f9bf65ff
commit 4064cbdfd9
3 changed files with 26 additions and 0 deletions

View File

@ -1628,3 +1628,27 @@ uicb_client_ignore_tag(uicb_t cmd)
return;
}
/** Set current client as master
*\para cmd uicb_t type unused
*/
void
uicb_client_set_master(uicb_t cmd)
{
Client *c;
(void)cmd;
/* get the first client */
screen_get_sel();
if(!sel || ishide(sel, selscreen))
return;
for(c = clients; c && ishide(c, selscreen); c = c->next);
if (c && c != sel)
{
client_swap(c, sel);
client_focus(c);
}
return;
}

View File

@ -50,6 +50,7 @@ const func_name_list_t func_list[] =
{"client_move", uicb_client_move },
{"client_resize", uicb_client_resize },
{"client_ignore_tag", uicb_client_ignore_tag },
{"client_set_master", uicb_client_set_master },
{"toggle_max", uicb_togglemax },
{"layout_next", uicb_layout_next },
{"layout_prev", uicb_layout_prev },

View File

@ -201,6 +201,7 @@ void uicb_ignore_next_client_rules(uicb_t cmd);
void uicb_clientlist(uicb_t cmd);
Bool uicb_checkclist(uicb_t);
void uicb_client_ignore_tag(uicb_t);
void uicb_client_set_master(uicb_t);
/* ewmh.c */
void ewmh_init_hints(void);