Conf/Event: Add option "focus_follow_mouse" in misc section request by gyo.
This commit is contained in:
parent
d8f3db227a
commit
42fa59a524
@ -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)
|
||||
{
|
||||
|
||||
@ -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()
|
||||
};
|
||||
|
||||
|
||||
17
src/event.c
17
src/event.c
@ -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;
|
||||
}
|
||||
|
||||
@ -282,6 +282,7 @@ typedef struct
|
||||
char *font;
|
||||
Bool raisefocus;
|
||||
Bool raiseswitch;
|
||||
Bool focus_fmouse;
|
||||
uint pad;
|
||||
struct
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user