diff --git a/config.h b/config.h index 0982748..2617b4a 100644 --- a/config.h +++ b/config.h @@ -51,6 +51,12 @@ // If on multi-head, place windows on monitor holding current window. #define MONITOR_START MONITOR_CURRENT +// Should new windows be automatically focused, or ignored until focused manually? +// IGNORE means new windows only steal focus if they obscure the current window. +// STEAL means new windows always steal focus. +#define FOCUS_START FOCUS_IGNORE +//#define FOCUS_START FOCUS_STEAL + // If you use "AnyModifier" place those keys at the end of the array. binding keys[] = { diff --git a/xoat.c b/xoat.c index b021a08..12c643e 100644 --- a/xoat.c +++ b/xoat.c @@ -697,7 +697,7 @@ void map_notify(XEvent *e) client_raise_family(c); client_update_border(c); // if no current window, or new window has opened in the current spot, focus it - if (!(a = window_build_client(current)) || (a && a->spot == c->spot)) + if (FOCUS_START == FOCUS_STEAL || !(a = window_build_client(current)) || (a && a->spot == c->spot)) client_set_focus(c); client_free(a); ewmh_client_list(); diff --git a/xoat.h b/xoat.h index 16d60e1..8a7d6ab 100644 --- a/xoat.h +++ b/xoat.h @@ -70,6 +70,11 @@ enum { SPOT1_RIGHT }; +enum { + FOCUS_IGNORE=1, + FOCUS_STEAL, +}; + typedef struct { short x, y, w, h; } box;