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
|
void
|
||||||
conf_misc_section(cfg_t *cfg_m)
|
conf_misc_section(cfg_t *cfg_m)
|
||||||
{
|
{
|
||||||
conf.font = alias_to_str(_strdup(cfg_getstr(cfg_m, "font")));
|
conf.font = alias_to_str(_strdup(cfg_getstr(cfg_m, "font")));
|
||||||
conf.raisefocus = cfg_getbool(cfg_m, "raisefocus");
|
conf.raisefocus = cfg_getbool(cfg_m, "raisefocus");
|
||||||
conf.raiseswitch = cfg_getbool(cfg_m, "raiseswitch");
|
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)
|
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_INT("pad", 12, CFGF_NONE),
|
||||||
CFG_BOOL("raisefocus", cfg_false, CFGF_NONE),
|
CFG_BOOL("raisefocus", cfg_false, CFGF_NONE),
|
||||||
CFG_BOOL("raiseswitch", cfg_true, CFGF_NONE),
|
CFG_BOOL("raiseswitch", cfg_true, CFGF_NONE),
|
||||||
|
CFG_BOOL("focus_follow_mouse", cfg_true, CFGF_NONE),
|
||||||
CFG_END()
|
CFG_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
17
src/event.c
17
src/event.c
@ -316,13 +316,16 @@ enternotify(XCrossingEvent *ev)
|
|||||||
&& ev->window != ROOT)
|
&& ev->window != ROOT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if((c = client_gb_win(ev->window))
|
if(conf.focus_fmouse)
|
||||||
|| (c = client_gb_frame(ev->window))
|
{
|
||||||
|| (c = client_gb_titlebar(ev->window))
|
if((c = client_gb_win(ev->window))
|
||||||
|| (c = client_gb_button(ev->window, &n)))
|
|| (c = client_gb_frame(ev->window))
|
||||||
client_focus(c);
|
|| (c = client_gb_titlebar(ev->window))
|
||||||
else
|
|| (c = client_gb_button(ev->window, &n)))
|
||||||
client_focus(NULL);
|
client_focus(c);
|
||||||
|
else
|
||||||
|
client_focus(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -282,6 +282,7 @@ typedef struct
|
|||||||
char *font;
|
char *font;
|
||||||
Bool raisefocus;
|
Bool raisefocus;
|
||||||
Bool raiseswitch;
|
Bool raiseswitch;
|
||||||
|
Bool focus_fmouse;
|
||||||
uint pad;
|
uint pad;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|||||||
@ -224,6 +224,12 @@ spawn(const char *format, ...)
|
|||||||
char cmd[512];
|
char cmd[512];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
if(strlen(format) > 511)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "WMFS spawn(): Error, command too long.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
vsprintf(cmd, format, ap);
|
vsprintf(cmd, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user