diff --git a/awesomerc.1.txt b/awesomerc.1.txt index 118cc938..f11855a7 100644 --- a/awesomerc.1.txt +++ b/awesomerc.1.txt @@ -251,6 +251,7 @@ screen [MULTI] general { allow_lower_floats=<{true,false}> + sloppy_focus=<{true,false}> border= focus_move_pointer=<{true,false}> font= diff --git a/config.c b/config.c index 57e25e9f..d0f8b077 100644 --- a/config.c +++ b/config.c @@ -345,6 +345,7 @@ config_parse_screen(cfg_t *cfg, int screen) virtscreen->opacity_unfocused = cfg_getint(cfg_general, "opacity_unfocused"); 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->font = XftFontOpenName(globalconf.display, phys_screen, cfg_getstr(cfg_general, "font")); @@ -477,6 +478,7 @@ config_parse(const char *confpatharg) CFG_INT((char *) "opacity_unfocused", 100, CFGF_NONE), 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_STR((char *) "font", (char *) "mono-12", CFGF_NONE), CFG_END() }; diff --git a/config.h b/config.h index 2086c46b..1a3df045 100644 --- a/config.h +++ b/config.h @@ -241,6 +241,8 @@ typedef struct Bool allow_lower_floats; /** Respect resize hints */ Bool resize_hints; + /** Sloppy focus: focus follow mouse */ + Bool sloppy_focus; /** Normal colors */ XColor colors_normal[ColLast]; /** Selected colors */ diff --git a/event.c b/event.c index 0d2da214..a9826279 100644 --- a/event.c +++ b/event.c @@ -232,10 +232,10 @@ handle_event_enternotify(XEvent * e) if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) return; - if((c = get_client_bywin(globalconf.clients, ev->window))) + if((c = get_client_bywin(globalconf.clients, ev->window)) && globalconf.screens[c->screen].sloppy_focus) { - curtags = get_current_tags(c->screen); focus(c, ev->same_screen, c->screen); + curtags = get_current_tags(c->screen); if (c->isfloating || curtags[0]->layout->arrange == layout_floating) window_grabbuttons(get_phys_screen(c->screen), c->win, True, False); p_delete(&curtags);