Refactor setting the default winopts

Move filling winopts with default values to after command line options have
been parsed, not after parsing the config file. This is more intuitive.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2018-12-24 18:28:00 +00:00
parent b434451abb
commit f41765fca5
3 changed files with 35 additions and 38 deletions

View File

@ -793,18 +793,7 @@ void get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
opt->refresh_rate = normalize_i_range(opt->refresh_rate, 0, 300);
// Apply default wintype options that are dependent on global options
for (int i = 0; i < NUM_WINTYPES; i++) {
auto wo = &opt->wintype_option[i];
auto mask = &winopt_mask[i];
if (!mask->shadow) {
wo->shadow = shadow_enable;
mask->shadow = true;
}
if (!mask->fade) {
wo->fade = fading_enable;
mask->fade = true;
}
}
set_default_winopts(opt, winopt_mask, shadow_enable, fading_enable);
// --blur-background-frame implies --blur-background
if (opt->blur_background_frame)