diff --git a/src/client.c b/src/client.c index 72208ef..5f70a97 100644 --- a/src/client.c +++ b/src/client.c @@ -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) diff --git a/src/config.c b/src/config.c index e5bced5..ed13fb1 100644 --- a/src/config.c +++ b/src/config.c @@ -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"); diff --git a/src/structs.h b/src/structs.h index 0847b9e..e09debf 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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; diff --git a/wmfsrc.in b/wmfsrc.in index 7779ea6..b2fb5d6 100644 --- a/wmfsrc.in +++ b/wmfsrc.in @@ -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]