Client/conf: Add automax option (same that autofree but for maximization) (Feature #62 requested by bacardi55)

This commit is contained in:
Martin Duquesnoy 2010-06-09 19:24:48 +02:00
parent 470606af1b
commit 32b3120fbd
4 changed files with 14 additions and 3 deletions

View File

@ -718,6 +718,7 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
free(t);
XUnmapWindow(dpy, c->win);
client_attach(c);
client_set_rules(c);
client_get_name(c);
@ -972,7 +973,7 @@ client_swap(Client *c1, Client *c2)
return;
}
/** Set the wanted tag or autofree of a client
/** Set the wanted tag or autofree/max of a client
*\param c Client pointer
*/
void
@ -994,6 +995,14 @@ client_set_rules(Client *c)
|| (xch.res_class && strstr(conf.client.autofree, xch.res_class))))
c->flags |= FreeFlag;
/* Auto free */
if(conf.client.automax && ((xch.res_name && strstr(conf.client.automax, xch.res_name))
|| (xch.res_class && strstr(conf.client.automax, xch.res_class))))
{
client_maximize(c);
c->flags |= MaxFlag;
}
/* Wanted tag */
for(i = 0; i < screen_count(); ++i)
for(j = 1; j < conf.ntag[i] + 1; ++j)

View File

@ -270,6 +270,7 @@ conf_client_section(void)
conf.client.set_new_win_master = fetch_opt_first(sec, "true", "set_new_win_master").bool;
conf.client.padding = fetch_opt_first(sec, "0", "padding").num;
conf.client.autofree = fetch_opt_first(sec, "", "autofree").str;
conf.client.automax = fetch_opt_first(sec, "", "automax").str;
mouse = fetch_section(sec, "mouse");

View File

@ -396,7 +396,7 @@ typedef struct
Bool place_at_mouse;
Bool border_shadow;
int borderheight;
char *autofree;
char *autofree, *automax;
uint bordernormal;
uint borderfocus;
uint resizecorner_normal;

View File

@ -130,8 +130,9 @@
# Modifier for mouse use
modifier = "Alt"
# Set automatic free client
# Set automatic free or max client
# autofree = "xterm|MPlayer"
# automax = "Navigator"
[mouse] button = "1" func = "client_raise" [/mouse]
[mouse] button = "1" func = "mouse_move" [/mouse]