Add autofocus option in [client] section

This commit is contained in:
David Delassus 2012-05-02 16:51:15 +02:00
parent 736f98e37f
commit 9d9460bfc0
3 changed files with 15 additions and 9 deletions

View File

@ -1006,6 +1006,8 @@ client_new(Window w, XWindowAttributes *wa, bool scan)
if(!scan) if(!scan)
{ {
client_get_name(c); client_get_name(c);
if(W->flags & WMFS_AUTOFOCUS)
client_focus(c);
client_configure(c); client_configure(c);
} }

View File

@ -240,6 +240,9 @@ config_client(void)
W->padding = fetch_opt_first(sec, "0", "padding").num; W->padding = fetch_opt_first(sec, "0", "padding").num;
W->client_mod = modkey_keysym(fetch_opt_first(sec, "Super", "key_modifier").str); 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 */ /* Get theme */
tmp = fetch_opt_first(sec, "default", "theme").str; tmp = fetch_opt_first(sec, "default", "theme").str;
W->ctheme = name_to_theme(tmp); W->ctheme = name_to_theme(tmp);

View File

@ -335,15 +335,16 @@ struct wmfs
int nscreen; int nscreen;
unsigned int client_mod; unsigned int client_mod;
Flags numlockmask; Flags numlockmask;
#define WMFS_SCAN 0x001 #define WMFS_SCAN 0x001
#define WMFS_RUNNING 0x002 #define WMFS_RUNNING 0x002
#define WMFS_RELOAD 0x004 #define WMFS_RELOAD 0x004
#define WMFS_SYSTRAY 0x008 #define WMFS_SYSTRAY 0x008
#define WMFS_LOG 0x010 #define WMFS_LOG 0x010
#define WMFS_LAUNCHER 0x020 #define WMFS_LAUNCHER 0x020
#define WMFS_SIGCHLD 0x040 #define WMFS_SIGCHLD 0x040
#define WMFS_TABNOC 0x080 /* tab next opened client */ #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_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; Flags flags;
GC gc, rgc; GC gc, rgc;
Atom *net_atom; Atom *net_atom;