Conf/Event: Add option "focus_follow_mouse" in misc section request by gyo.

This commit is contained in:
martin 2009-07-03 19:04:09 +02:00
parent d8f3db227a
commit 42fa59a524
6 changed files with 26 additions and 13 deletions

View File

@ -125,9 +125,10 @@ conf_alias_section(cfg_t *cfg_a)
void
conf_misc_section(cfg_t *cfg_m)
{
conf.font = alias_to_str(_strdup(cfg_getstr(cfg_m, "font")));
conf.raisefocus = cfg_getbool(cfg_m, "raisefocus");
conf.raiseswitch = cfg_getbool(cfg_m, "raiseswitch");
conf.font = alias_to_str(_strdup(cfg_getstr(cfg_m, "font")));
conf.raisefocus = cfg_getbool(cfg_m, "raisefocus");
conf.raiseswitch = cfg_getbool(cfg_m, "raiseswitch");
conf.focus_fmouse = cfg_getbool(cfg_m, "focus_follow_mouse");
if(cfg_getint(cfg_m, "pad") > 24 || cfg_getint(cfg_m, "pad") < 1)
{

View File

@ -43,6 +43,7 @@ cfg_opt_t misc_opts[] =
CFG_INT("pad", 12, CFGF_NONE),
CFG_BOOL("raisefocus", cfg_false, CFGF_NONE),
CFG_BOOL("raiseswitch", cfg_true, CFGF_NONE),
CFG_BOOL("focus_follow_mouse", cfg_true, CFGF_NONE),
CFG_END()
};

View File

@ -316,13 +316,16 @@ enternotify(XCrossingEvent *ev)
&& ev->window != ROOT)
return;
if((c = client_gb_win(ev->window))
|| (c = client_gb_frame(ev->window))
|| (c = client_gb_titlebar(ev->window))
|| (c = client_gb_button(ev->window, &n)))
client_focus(c);
else
client_focus(NULL);
if(conf.focus_fmouse)
{
if((c = client_gb_win(ev->window))
|| (c = client_gb_frame(ev->window))
|| (c = client_gb_titlebar(ev->window))
|| (c = client_gb_button(ev->window, &n)))
client_focus(c);
else
client_focus(NULL);
}
return;
}

View File

@ -282,6 +282,7 @@ typedef struct
char *font;
Bool raisefocus;
Bool raiseswitch;
Bool focus_fmouse;
uint pad;
struct
{

View File

@ -224,6 +224,12 @@ spawn(const char *format, ...)
char cmd[512];
va_list ap;
if(strlen(format) > 511)
{
fprintf(stderr, "WMFS spawn(): Error, command too long.\n");
return;
}
va_start(ap, format);
vsprintf(cmd, format, ap);
va_end(ap);

View File

@ -10,9 +10,10 @@ alias
misc
{
font = "dejavu-10"
raisefocus = false
raiseswitch = true
font = "dejavu-10"
raisefocus = false
raiseswitch = true
focus_follow_mouse = true
pad = 12
}