diff --git a/awesomerc.1.txt b/awesomerc.1.txt index f11855a77..d1ee56782 100644 --- a/awesomerc.1.txt +++ b/awesomerc.1.txt @@ -252,6 +252,7 @@ screen [MULTI] { allow_lower_floats=<{true,false}> sloppy_focus=<{true,false}> + new_become_master<{true,false}> border= focus_move_pointer=<{true,false}> font= diff --git a/client.c b/client.c index 4f859880b..97a9f1525 100644 --- a/client.c +++ b/client.c @@ -321,7 +321,6 @@ client_manage(Window w, XWindowAttributes *wa, int screen) c->h = c->rh = wa->height; c->oldborder = wa->border_width; - globalconf.display = globalconf.display; c->screen = get_screen_bycoord(c->x, c->y); move_client_to_screen(c, screen, True); @@ -408,7 +407,12 @@ client_manage(Window w, XWindowAttributes *wa, int screen) break; } if(!rule) - client_attach(c); + { + if(globalconf.screens[c->screen].new_become_master) + client_attach(c); + else + client_attach_at_end(c); + } /* some windows require this */ XMoveResizeWindow(globalconf.display, c->win, c->x, c->y, c->w, c->h); diff --git a/config.c b/config.c index d0f8b0778..476147db0 100644 --- a/config.c +++ b/config.c @@ -346,6 +346,7 @@ config_parse_screen(cfg_t *cfg, int screen) virtscreen->focus_move_pointer = cfg_getbool(cfg_general, "focus_move_pointer"); virtscreen->allow_lower_floats = cfg_getbool(cfg_general, "allow_lower_floats"); virtscreen->sloppy_focus = cfg_getbool(cfg_general, "sloppy_focus"); + virtscreen->new_become_master = cfg_getbool(cfg_general, "new_become_master"); virtscreen->font = XftFontOpenName(globalconf.display, phys_screen, cfg_getstr(cfg_general, "font")); @@ -479,6 +480,7 @@ config_parse(const char *confpatharg) CFG_BOOL((char *) "focus_move_pointer", cfg_false, CFGF_NONE), CFG_BOOL((char *) "allow_lower_floats", cfg_false, CFGF_NONE), CFG_BOOL((char *) "sloppy_focus", cfg_true, CFGF_NONE), + CFG_BOOL((char *) "new_become_master", cfg_true, CFGF_NONE), CFG_STR((char *) "font", (char *) "mono-12", CFGF_NONE), CFG_END() }; diff --git a/config.h b/config.h index 1a3df0459..384bc007e 100644 --- a/config.h +++ b/config.h @@ -243,6 +243,8 @@ typedef struct Bool resize_hints; /** Sloppy focus: focus follow mouse */ Bool sloppy_focus; + /** True if new clients should become master */ + Bool new_become_master; /** Normal colors */ XColor colors_normal[ColLast]; /** Selected colors */