Put the default value in the defaults
This commit is contained in:
parent
7a22fa0e5f
commit
88175b259a
6
config.h
6
config.h
@ -102,6 +102,12 @@ settings_t defaults = {
|
|||||||
.code = 0,.sym = NoSymbol,.is_valid = false
|
.code = 0,.sym = NoSymbol,.is_valid = false
|
||||||
}, /* ignore this */
|
}, /* ignore this */
|
||||||
|
|
||||||
|
.mouse_left_click = MOUSE_CLOSE_CURRENT,
|
||||||
|
|
||||||
|
.mouse_middle_click = MOUSE_DO_ACTION,
|
||||||
|
|
||||||
|
.mouse_right_click = MOUSE_CLOSE_ALL,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
rule_t default_rules[] = {
|
rule_t default_rules[] = {
|
||||||
|
@ -537,33 +537,48 @@ void load_settings(char *cmdline_config_path)
|
|||||||
{
|
{
|
||||||
char *c = option_get_string(
|
char *c = option_get_string(
|
||||||
"global",
|
"global",
|
||||||
"mouse_left_click", "-left_click", "close_current",
|
"mouse_left_click", "-left_click", NULL,
|
||||||
"Action of Left click event"
|
"Action of Left click event"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (c) {
|
||||||
settings.mouse_left_click = parse_mouse_action(c);
|
settings.mouse_left_click = parse_mouse_action(c);
|
||||||
|
} else {
|
||||||
|
settings.mouse_left_click = defaults.mouse_left_click;
|
||||||
|
}
|
||||||
|
|
||||||
g_free(c);
|
g_free(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
char *c = option_get_string(
|
char *c = option_get_string(
|
||||||
"global",
|
"global",
|
||||||
"mouse_middle_click", "-mouse_middle_click", "do_action",
|
"mouse_middle_click", "-mouse_middle_click", NULL,
|
||||||
"Action of middle click event"
|
"Action of middle click event"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (c) {
|
||||||
settings.mouse_middle_click = parse_mouse_action(c);
|
settings.mouse_middle_click = parse_mouse_action(c);
|
||||||
|
} else {
|
||||||
|
settings.mouse_middle_click = defaults.mouse_middle_click;
|
||||||
|
}
|
||||||
|
|
||||||
g_free(c);
|
g_free(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
char *c = option_get_string(
|
char *c = option_get_string(
|
||||||
"global",
|
"global",
|
||||||
"mouse_right_click", "-mouse_right_click", "close_all",
|
"mouse_right_click", "-mouse_right_click", NULL,
|
||||||
"Action of right click event"
|
"Action of right click event"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (c) {
|
||||||
settings.mouse_right_click = parse_mouse_action(c);
|
settings.mouse_right_click = parse_mouse_action(c);
|
||||||
|
} else {
|
||||||
|
settings.mouse_right_click = defaults.mouse_right_click;
|
||||||
|
}
|
||||||
|
|
||||||
g_free(c);
|
g_free(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user