From 736f98e37f961f01995540f6400893f49bea7184 Mon Sep 17 00:00:00 2001 From: David Delassus Date: Wed, 2 May 2012 16:39:42 +0200 Subject: [PATCH 1/2] Don't change focused window when creating a new client --- src/client.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client.c b/src/client.c index ba31219..f549d3a 100644 --- a/src/client.c +++ b/src/client.c @@ -1006,7 +1006,6 @@ client_new(Window w, XWindowAttributes *wa, bool scan) if(!scan) { client_get_name(c); - client_focus(c); client_configure(c); } From 9d9460bfc0805d38ed3ec7bade6827b63880d68b Mon Sep 17 00:00:00 2001 From: David Delassus Date: Wed, 2 May 2012 16:51:15 +0200 Subject: [PATCH 2/2] Add autofocus option in [client] section --- src/client.c | 2 ++ src/config.c | 3 +++ src/wmfs.h | 19 ++++++++++--------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/client.c b/src/client.c index f549d3a..39c9bc6 100644 --- a/src/client.c +++ b/src/client.c @@ -1006,6 +1006,8 @@ client_new(Window w, XWindowAttributes *wa, bool scan) if(!scan) { client_get_name(c); + if(W->flags & WMFS_AUTOFOCUS) + client_focus(c); client_configure(c); } diff --git a/src/config.c b/src/config.c index 4e2619b..40a3610 100644 --- a/src/config.c +++ b/src/config.c @@ -240,6 +240,9 @@ config_client(void) W->padding = fetch_opt_first(sec, "0", "padding").num; W->client_mod = modkey_keysym(fetch_opt_first(sec, "Super", "key_modifier").str); + if(fetch_opt_first(sec, "0", "autofocus").boolean) + W->flags |= WMFS_AUTOFOCUS; + /* Get theme */ tmp = fetch_opt_first(sec, "default", "theme").str; W->ctheme = name_to_theme(tmp); diff --git a/src/wmfs.h b/src/wmfs.h index d21967d..1e6a4b4 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -335,15 +335,16 @@ struct wmfs int nscreen; unsigned int client_mod; Flags numlockmask; -#define WMFS_SCAN 0x001 -#define WMFS_RUNNING 0x002 -#define WMFS_RELOAD 0x004 -#define WMFS_SYSTRAY 0x008 -#define WMFS_LOG 0x010 -#define WMFS_LAUNCHER 0x020 -#define WMFS_SIGCHLD 0x040 -#define WMFS_TABNOC 0x080 /* tab next opened client */ -#define WMFS_TAGCIRC 0x100 /* tab_next on last tag -> go to first tag / tab_prev on first tag -> go to last tag */ +#define WMFS_SCAN 0x001 +#define WMFS_RUNNING 0x002 +#define WMFS_RELOAD 0x004 +#define WMFS_SYSTRAY 0x008 +#define WMFS_LOG 0x010 +#define WMFS_LAUNCHER 0x020 +#define WMFS_SIGCHLD 0x040 +#define WMFS_TABNOC 0x080 /* tab next opened client */ +#define WMFS_TAGCIRC 0x100 /* tab_next on last tag -> go to first tag / tab_prev on first tag -> go to last tag */ +#define WMFS_AUTOFOCUS 0x200 Flags flags; GC gc, rgc; Atom *net_atom;