Merge branch 'master' of git.wmfs.info:wmfs

This commit is contained in:
Martin Duquesnoy 2009-11-02 20:09:27 +01:00
commit 1b16cb9229
6 changed files with 43 additions and 20 deletions

View File

@ -558,6 +558,9 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
if(ar)
arrange(c->screen, True);
if(conf.client.set_new_win_master)
layout_set_client_master(c);
return c;
}

View File

@ -193,6 +193,7 @@ conf_client_section(char *src)
conf.client.resizecorner_normal = getcolor(get_opt(src, "#222222", "resize_corner_normal").str);
conf.client.resizecorner_focus = getcolor(get_opt(src, "#DDDDDD", "resize_corner_focus").str);
conf.client.mod |= char_to_modkey(get_opt(src, "Alt", "modifier").str, key_list);
conf.client.set_new_win_master = get_opt(src, "true", "set_new_win_master").bool;
if((conf.client.nmouse = get_size_sec(src, "mouse")))
{

View File

@ -275,7 +275,17 @@ complete_on_files(char *start, size_t hits)
path = _strdup(".");
else
{
dirname = _strdup(p);
/* remplace ~ by $HOME in dirname */
if (!strncmp(p, "~/", 2) && getenv("HOME"))
asprintf(&dirname, "%s%s", getenv("HOME"), p+1);
else
dirname = _strdup(p);
/* Set p to filename to be complete
* and path the directory containing the file
* /foooooo/baaaaaar/somethinglikethis<tab>
* <---- path - ---><------- p ------>
*/
p = strrchr(dirname, '/');
if (p != dirname)
{

View File

@ -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;
}

View File

@ -348,6 +348,7 @@ typedef struct
} root;
struct
{
Bool set_new_win_master;
Bool place_at_mouse;
Bool border_shadow;
int borderheight;
@ -356,7 +357,7 @@ typedef struct
uint resizecorner_normal;
uint resizecorner_focus;
uint mod;
MouseBinding *mouse;
MouseBinding *mouse;
int nmouse;
} client;
struct

View File

@ -303,7 +303,7 @@ void uicb_set_layout(uicb_t);
void uicb_toggle_resizehint(uicb_t);
void uicb_set_layer(uicb_t cmd);
void uicb_set_client_layer(uicb_t cmd);
void layout_set_client_master(Client *c);
/* init.c */
void init(void);