diff --git a/common/configopts.c b/common/configopts.c index 87b0b2057..64752637b 100644 --- a/common/configopts.c +++ b/common/configopts.c @@ -423,6 +423,8 @@ cfg_new(void) cfg_set_validate_func(cfg, "screen|tags|tag|ncol", config_validate_supone_int); /* Check float values */ + cfg_set_validate_func(cfg, "screen|general|mwfact_lower_limit", config_validate_zero_one_float); + cfg_set_validate_func(cfg, "screen|general|mwfact_upper_limit", config_validate_zero_one_float); cfg_set_validate_func(cfg, "screen|tags|tag|mwfact", config_validate_zero_one_float); return cfg; diff --git a/config.c b/config.c index c6acb741d..317a728f8 100644 --- a/config.c +++ b/config.c @@ -334,20 +334,6 @@ config_parse_screen(cfg_t *cfg, int screen) virtscreen->mwfact_lower_limit = cfg_getfloat(cfg_general, "mwfact_lower_limit"); virtscreen->mwfact_upper_limit = cfg_getfloat(cfg_general, "mwfact_upper_limit"); - if(virtscreen->mwfact_lower_limit < 0 || virtscreen->mwfact_lower_limit > 1) - { - warn("incorrect value %f for mwfact_lower_limit, must be between 0 and 1\n", - virtscreen->mwfact_lower_limit); - virtscreen->mwfact_lower_limit = 0.1; - } - - if(virtscreen->mwfact_upper_limit < 0 || virtscreen->mwfact_upper_limit > 1) - { - warn("incorrect value %f for mwfact_upper_limit, must be between 0 and 1\n", - virtscreen->mwfact_lower_limit); - virtscreen->mwfact_upper_limit = 0.9; - } - if(virtscreen->mwfact_upper_limit < virtscreen->mwfact_lower_limit) { warn("mwfact_upper_limit must be greater than mwfact_lower_limit\n");