mirror of https://github.com/yshui/picom.git
core: move the many c2_list_postprocess calls into a function
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
bc7b697915
commit
ac376ad6cb
|
@ -19,6 +19,7 @@
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
|
#include "x.h"
|
||||||
|
|
||||||
#pragma GCC diagnostic error "-Wunused-parameter"
|
#pragma GCC diagnostic error "-Wunused-parameter"
|
||||||
|
|
||||||
|
@ -381,9 +382,7 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
|
||||||
while (-1 != (o = getopt_long(argc, argv, shortopts, longopts, &longopt_idx))) {
|
while (-1 != (o = getopt_long(argc, argv, shortopts, longopts, &longopt_idx))) {
|
||||||
switch (o) {
|
switch (o) {
|
||||||
#define P_CASEBOOL(idx, option) \
|
#define P_CASEBOOL(idx, option) \
|
||||||
case idx: \
|
case idx: opt->option = true; break
|
||||||
opt->option = true; \
|
|
||||||
break
|
|
||||||
#define P_CASELONG(idx, option) \
|
#define P_CASELONG(idx, option) \
|
||||||
case idx: \
|
case idx: \
|
||||||
if (!parse_long(optarg, &opt->option)) { \
|
if (!parse_long(optarg, &opt->option)) { \
|
||||||
|
@ -897,4 +896,23 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void options_postprocess_c2_lists(struct c2_state *state, struct x_connection *c,
|
||||||
|
struct options *option) {
|
||||||
|
if (!(c2_list_postprocess(state, c->c, option->unredir_if_possible_blacklist) &&
|
||||||
|
c2_list_postprocess(state, c->c, option->paint_blacklist) &&
|
||||||
|
c2_list_postprocess(state, c->c, option->shadow_blacklist) &&
|
||||||
|
c2_list_postprocess(state, c->c, option->shadow_clip_list) &&
|
||||||
|
c2_list_postprocess(state, c->c, option->fade_blacklist) &&
|
||||||
|
c2_list_postprocess(state, c->c, option->blur_background_blacklist) &&
|
||||||
|
c2_list_postprocess(state, c->c, option->invert_color_list) &&
|
||||||
|
c2_list_postprocess(state, c->c, option->window_shader_fg_rules) &&
|
||||||
|
c2_list_postprocess(state, c->c, option->opacity_rules) &&
|
||||||
|
c2_list_postprocess(state, c->c, option->rounded_corners_blacklist) &&
|
||||||
|
c2_list_postprocess(state, c->c, option->corner_radius_rules) &&
|
||||||
|
c2_list_postprocess(state, c->c, option->focus_blacklist))) {
|
||||||
|
log_error("Post-processing of conditionals failed, some of your rules "
|
||||||
|
"might not work");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// vim: set noet sw=8 ts=8 :
|
// vim: set noet sw=8 ts=8 :
|
||||||
|
|
|
@ -33,5 +33,7 @@ bool get_early_config(int argc, char *const *argv, char **config_file, bool *all
|
||||||
bool must_use get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
|
bool must_use get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
|
||||||
bool fading_enable, bool conv_kern_hasneg,
|
bool fading_enable, bool conv_kern_hasneg,
|
||||||
win_option_mask_t *winopt_mask);
|
win_option_mask_t *winopt_mask);
|
||||||
|
void options_postprocess_c2_lists(struct c2_state *state, struct x_connection *c,
|
||||||
|
struct options *option);
|
||||||
|
|
||||||
// vim: set noet sw=8 ts=8:
|
// vim: set noet sw=8 ts=8:
|
||||||
|
|
16
src/picom.c
16
src/picom.c
|
@ -2258,21 +2258,7 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
|
||||||
ps->c2_state = c2_state_new(ps->atoms);
|
ps->c2_state = c2_state_new(ps->atoms);
|
||||||
|
|
||||||
// Get needed atoms for c2 condition lists
|
// Get needed atoms for c2 condition lists
|
||||||
if (!(c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.unredir_if_possible_blacklist) &&
|
options_postprocess_c2_lists(ps->c2_state, &ps->c, &ps->o);
|
||||||
c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.paint_blacklist) &&
|
|
||||||
c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.shadow_blacklist) &&
|
|
||||||
c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.shadow_clip_list) &&
|
|
||||||
c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.fade_blacklist) &&
|
|
||||||
c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.blur_background_blacklist) &&
|
|
||||||
c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.invert_color_list) &&
|
|
||||||
c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.window_shader_fg_rules) &&
|
|
||||||
c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.opacity_rules) &&
|
|
||||||
c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.rounded_corners_blacklist) &&
|
|
||||||
c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.corner_radius_rules) &&
|
|
||||||
c2_list_postprocess(ps->c2_state, ps->c.c, ps->o.focus_blacklist))) {
|
|
||||||
log_error("Post-processing of conditionals failed, some of your rules "
|
|
||||||
"might not work");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load shader source file specified in the shader rules
|
// Load shader source file specified in the shader rules
|
||||||
if (c2_list_foreach(ps->o.window_shader_fg_rules, load_shader_source_for_condition, ps)) {
|
if (c2_list_foreach(ps->o.window_shader_fg_rules, load_shader_source_for_condition, ps)) {
|
||||||
|
|
Loading…
Reference in New Issue