Add option to set the new windows as master or not
This commit is contained in:
42
src/layout.c
42
src/layout.c
@@ -756,23 +756,7 @@ mirror_horizontal(int screen)
|
||||
void
|
||||
uicb_tile_switch(uicb_t cmd)
|
||||
{
|
||||
Client *c;
|
||||
|
||||
screen_get_sel();
|
||||
|
||||
if(!sel
|
||||
|| (sel->flags & HintFlag)
|
||||
|| !(sel->flags & TileFlag)
|
||||
|| (sel->flags & FSSFlag))
|
||||
return;
|
||||
|
||||
if((c = sel) == tiled_client(selscreen, clients))
|
||||
CHECK((c = tiled_client(selscreen, c->next)));
|
||||
client_detach(c);
|
||||
client_attach(c);
|
||||
client_focus(c);
|
||||
tags[selscreen][seltag[selscreen]].layout.func(selscreen);
|
||||
|
||||
layout_set_client_master (sel);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -869,3 +853,27 @@ uicb_set_layout(uicb_t cmd)
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** Set the client as master
|
||||
* \param c Client
|
||||
*/
|
||||
void
|
||||
layout_set_client_master(Client *c)
|
||||
{
|
||||
screen_get_sel();
|
||||
|
||||
if(!c
|
||||
|| (c->flags & HintFlag)
|
||||
|| !(c->flags & TileFlag)
|
||||
|| (c->flags & FSSFlag))
|
||||
return;
|
||||
|
||||
if(c == tiled_client(selscreen, clients))
|
||||
CHECK((c = tiled_client(selscreen, c->next)));
|
||||
client_detach(c);
|
||||
client_attach(c);
|
||||
client_focus(c);
|
||||
tags[selscreen][seltag[selscreen]].layout.func(selscreen);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user