From 1ff72ed2bd6cfe4ddee8ac4bf338e3205d37274c Mon Sep 17 00:00:00 2001 From: seanpringle Date: Tue, 11 Sep 2012 10:41:06 +1000 Subject: [PATCH] config.h FOCUS_START --- config.h | 6 ++++++ xoat.c | 2 +- xoat.h | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) 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;