#include "prop.h"
#include "dispatch.h"
#include "focus.h"
+#include "parse.h"
#include <X11/Xlib.h>
#include <glib.h>
gboolean focus_new = TRUE;
gboolean focus_follow = TRUE;
+static void parse_assign(char *name, ParseToken *value)
+{
+ if (!g_ascii_strcasecmp(name, "focusnew")) {
+ if (value->type != TOKEN_BOOL)
+ yyerror("invalid value");
+ else {
+ focus_new = value->data.bool;
+ }
+ } else if (!g_ascii_strcasecmp(name, "followmouse")) {
+ if (value->type != TOKEN_BOOL)
+ yyerror("invalid value");
+ else {
+ focus_follow = value->data.bool;
+ }
+ } else
+ yyerror("invalid option");
+ parse_free_token(value);
+}
+
void focus_startup()
{
/* create the window which gets focus when no clients get it. Have to
/* start with nothing focused */
focus_set_client(NULL);
+
+ parse_reg_section("focus", NULL, parse_assign);
}
void focus_shutdown()