@@ -2469,7 +2469,7 @@ static void
2469
2469
win_update_opacity_rule (session_t * ps , win * w ) {
2470
2470
// If long is 32-bit, unfortunately there's no way could we express "unset",
2471
2471
// so we just entirely don't distinguish "unset" and OPAQUE
2472
- long opacity = OPAQUE ;
2472
+ opacity_t opacity = OPAQUE ;
2473
2473
void * val = NULL ;
2474
2474
if (c2_matchd (ps , w , ps -> o .opacity_rules , & w -> cache_oparule , & val ))
2475
2475
opacity = ((double ) (long ) val ) / 100.0 * OPAQUE ;
@@ -5029,9 +5029,8 @@ parse_cfg_condlst(session_t *ps, const config_t *pcfg, c2_lptr_t **pcondlst,
5029
5029
// Parse an array of options
5030
5030
if (config_setting_is_array (setting )) {
5031
5031
int i = config_setting_length (setting );
5032
- while (i -- ) {
5032
+ while (i -- )
5033
5033
condlst_add (ps , pcondlst , config_setting_get_string_elem (setting , i ));
5034
- }
5035
5034
}
5036
5035
// Treat it as a single pattern if it's a string
5037
5036
else if (CONFIG_TYPE_STRING == config_setting_type (setting )) {
@@ -5040,6 +5039,26 @@ parse_cfg_condlst(session_t *ps, const config_t *pcfg, c2_lptr_t **pcondlst,
5040
5039
}
5041
5040
}
5042
5041
5042
+ /**
5043
+ * Parse an opacity rule list in configuration file.
5044
+ */
5045
+ static inline void
5046
+ parse_cfg_condlst_opct (session_t * ps , const config_t * pcfg , const char * name ) {
5047
+ config_setting_t * setting = config_lookup (pcfg , name );
5048
+ if (setting ) {
5049
+ // Parse an array of options
5050
+ if (config_setting_is_array (setting )) {
5051
+ int i = config_setting_length (setting );
5052
+ while (i -- )
5053
+ parse_rule_opacity (ps , config_setting_get_string_elem (setting , i ));
5054
+ }
5055
+ // Treat it as a single pattern if it's a string
5056
+ else if (CONFIG_TYPE_STRING == config_setting_type (setting )) {
5057
+ parse_rule_opacity (ps , config_setting_get_string (setting ));
5058
+ }
5059
+ }
5060
+ }
5061
+
5043
5062
/**
5044
5063
* Parse a configuration file from default location.
5045
5064
*/
@@ -5213,7 +5232,7 @@ parse_config(session_t *ps, struct options_tmp *pcfgtmp) {
5213
5232
// --blur-background-exclude
5214
5233
parse_cfg_condlst (ps , & cfg , & ps -> o .blur_background_blacklist , "blur-background-exclude" );
5215
5234
// --opacity-rule
5216
- parse_cfg_condlst (ps , & cfg , & ps -> o . opacity_rules , "opacity-rule" );
5235
+ parse_cfg_condlst_opct (ps , & cfg , "opacity-rule" );
5217
5236
// --unredir-if-possible-exclude
5218
5237
parse_cfg_condlst (ps , & cfg , & ps -> o .unredir_if_possible_blacklist , "unredir-if-possible-exclude" );
5219
5238
// --blur-background
0 commit comments