int container_stack_limit;
int container_stack_limit_value;
- bool focus_follows_mouse;
+ /** By default, focus follows mouse. If the user explicitly wants to
+ * turn this off (and instead rely only on the keyboard for changing
+ * focus), we allow him to do this with this relatively special option.
+ * It is not planned to add any different focus models. */
+ bool disable_focus_follows_mouse;
const char *default_border;
}
;
+bool:
+ NUMBER
+ {
+ $<number>$ = ($<number>1 == 1);
+ }
+ | WORD
+ {
+ DLOG("checking word \"%s\"\n", $<string>1);
+ $<number>$ = (strcasecmp($<string>1, "yes") == 0 ||
+ strcasecmp($<string>1, "true") == 0 ||
+ strcasecmp($<string>1, "on") == 0 ||
+ strcasecmp($<string>1, "enable") == 0 ||
+ strcasecmp($<string>1, "active") == 0);
+ }
+ ;
+
focus_follows_mouse:
- TOKFOCUSFOLLOWSMOUSE WHITESPACE NUMBER
+ TOKFOCUSFOLLOWSMOUSE WHITESPACE bool
{
- config.focus_follows_mouse = ($<number>3 == 0 ? 0 : 1);
+ DLOG("focus follows mouse = %d\n", $<number>3);
+ config.disable_focus_follows_mouse = !($<number>3);
}
;
return 1;
}
- if (config.focus_follows_mouse)
+ if (!config.disable_focus_follows_mouse)
set_focus(conn, client, false);
return 1;