aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorallusive-dev <[email protected]>2023-11-09 11:14:39 +1100
committerallusive-dev <[email protected]>2023-11-09 11:14:39 +1100
commita51f4229715d3edc4c4b609764cc9328d9940232 (patch)
tree7e63e3e2c23fcf75d52287d9e9da14ec2af9d980 /src
parentUpdate README.md (diff)
downloadcompfy-1.4.0.tar.xz
compfy-1.4.0.zip
added blur whitelist toggle according to request in #17. Deprecated focus-exclude in favor of active-exclude and inactive-exclude. Focus wintype option now works as expected1.4.0
Diffstat (limited to 'src')
-rw-r--r--src/config.c1
-rw-r--r--src/config.h2
-rw-r--r--src/config_libconfig.c8
-rw-r--r--src/options.c14
-rw-r--r--src/win.c35
5 files changed, 38 insertions, 22 deletions
diff --git a/src/config.c b/src/config.c
index 2eefda1..e3ea9c6 100644
--- a/src/config.c
+++ b/src/config.c
@@ -860,6 +860,7 @@ char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable,
.corner_rules = NULL,
.blur_rules = NULL,
+ .blur_whitelist = true,
.support_for_wm = WM_SUPPORT_NONE,
diff --git a/src/config.h b/src/config.h
index 1436495..4169bae 100644
--- a/src/config.h
+++ b/src/config.h
@@ -232,6 +232,8 @@ typedef struct options {
// Wm Support
enum wm_support support_for_wm;
+ bool blur_whitelist;
+
// === Opacity ===
/// Default opacity for inactive windows.
/// 32-bit integer with the format of _NET_WM_WINDOW_OPACITY.
diff --git a/src/config_libconfig.c b/src/config_libconfig.c
index 1b81a50..ac4eb96 100644
--- a/src/config_libconfig.c
+++ b/src/config_libconfig.c
@@ -578,22 +578,23 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
lcfg_lookup_bool(&cfg, "animation-clamping", &opt->animation_clamping);
// --focus-exclude
parse_cfg_condlst(&cfg, &opt->focus_blacklist, "focus-exclude");
+
// --invert-color-include
parse_cfg_condlst(&cfg, &opt->invert_color_list, "invert-color-include");
// --blur-background-exclude
- parse_cfg_condlst(&cfg, &opt->blur_background_blacklist, "blur-background-exclude");
+ parse_cfg_condlst(&cfg, &opt->blur_background_blacklist, "blur-exclude");
// animation exclude
parse_cfg_condlst(&cfg, &opt->animation_open_blacklist, "animation-open-exclude");
// animation exclude
parse_cfg_condlst(&cfg, &opt->animation_unmap_blacklist, "animation-unmap-exclude");
// active opacity exclude
- parse_cfg_condlst(&cfg, &opt->active_opacity_blacklist, "active-opacity-exclude");
+ parse_cfg_condlst(&cfg, &opt->active_opacity_blacklist, "active-exclude");
// inactive opacity exclude
parse_cfg_condlst(&cfg, &opt->inactive_opacity_blacklist, "inactive-exclude");
// corners-rule
parse_cfg_condlst_corner(opt, &cfg, "corners-rule");
// blur-rule
- parse_cfg_condlst(&cfg, &opt->blur_rules, "blur-rule");
+ parse_cfg_condlst(&cfg, &opt->blur_rules, "blur-include");
// wm-support
if (config_lookup_string(&cfg, "wm-support", &sval)) {
enum wm_support wm = parse_wm_support(sval);
@@ -603,6 +604,7 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
}
opt->support_for_wm = wm;
}
+ lcfg_lookup_bool(&cfg, "blur-whitelist", &opt->blur_whitelist);
// --opacity-rule
parse_cfg_condlst_opct(opt, &cfg, "opacity-rule");
// --unredir-if-possible-exclude
diff --git a/src/options.c b/src/options.c
index c98a77e..c5f183c 100644
--- a/src/options.c
+++ b/src/options.c
@@ -108,7 +108,7 @@ static const struct picom_option picom_options[] = {
{"benchmark" , required_argument, 293, NULL , "Benchmark mode. Repeatedly paint until reaching the specified cycles."},
{"benchmark-wid" , required_argument, 294, NULL , "Specify window ID to repaint in benchmark mode. If omitted or is 0, the whole"
" screen is repainted."},
- {"blur-background-exclude" , required_argument, 296, "COND" , "Exclude conditions for background blur."},
+ {"blur-exclude" , required_argument, 296, "COND" , "Exclude conditions for background blur."},
{"active-opacity" , required_argument, 297, NULL , "Default opacity for active windows. (0.0 - 1.0)"},
{"glx-no-rebind-pixmap" , no_argument , 298, NULL , NULL},
{"glx-swap-method" , required_argument, 299, NULL , NULL},
@@ -176,20 +176,21 @@ static const struct picom_option picom_options[] = {
{"no-ewmh-fullscreen" , no_argument , 803, NULL , "Do not use EWMH to detect fullscreen windows. Reverts to checking if a "
"window is fullscreen based only on its size and coordinates."},
{"animations", no_argument, 804, NULL, "Toggles Animations"},
- {"animation-stiffness", required_argument, 805, NULL, "stiffness"},
- {"animation-dampening", required_argument, 806, NULL, "dampening"},
- {"animation-window-mass", required_argument, 807, NULL, "window mass"},
- {"animation-clamping", no_argument, 808, NULL, "clamping"},
+ {"animation-stiffness", required_argument, 805, NULL, "animation stiffness"},
+ {"animation-dampening", required_argument, 806, NULL, "animation dampening"},
+ {"animation-window-mass", required_argument, 807, NULL, "animation window mass"},
+ {"animation-clamping", no_argument, 808, NULL, "toggle animation clamping"},
{"animation-for-open-window", required_argument, 809, NULL, "open window animation"},
// {"animation-for-transient-window", required_argument, 810, NULL, "transient window animation"},
{"animation-for-unmap-window", required_argument, 811, NULL, "unmap window animation"},
{"corners-rule", required_argument, 812, NULL, "rounded corner rules"},
- {"blur-rule", required_argument, 813, NULL, "blur rules"},
+ {"blur-include", required_argument, 813, NULL, "blur rules"},
{"animation-open-exclude", required_argument, 814, NULL, "animation open exclude list"},
{"animation-unmap-exclude", required_argument, 815, NULL, "animation unmap exclude list"},
{"wm-support", required_argument, 816, NULL, "Set specific window manager support"},
{"active-opacity-exclude", required_argument, 817, NULL, "Exclude windows from being affected by active opacity"},
{"inactive-exclude", required_argument, 818, NULL, "Exclude windows from being affected by inactive opacity"},
+ {"blur-whitelist", no_argument, 819, NULL, "Toggles Blur Whitelisting"},
};
// clang-format on
@@ -815,6 +816,7 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
case 818:
condlst_add(&opt->inactive_opacity_blacklist, optarg);
break;
+ P_CASEBOOL(819, blur_whitelist);
default: usage(argv[0], 1); break;
#undef P_CASEBOOL
}
diff --git a/src/win.c b/src/win.c
index 73710f7..907a946 100644
--- a/src/win.c
+++ b/src/win.c
@@ -143,12 +143,14 @@ static void win_update_focused(session_t *ps, struct managed_win *w) {
// Use wintype_focus, and treat WM windows and override-redirected
// windows specially
- if (ps->o.wintype_option[w->window_type].focus ||
- (ps->o.mark_wmwin_focused && w->wmwin) ||
- (ps->o.mark_ovredir_focused && w->base.id == w->client_win && !w->wmwin) ||
- (w->a.map_state == XCB_MAP_STATE_VIEWABLE &&
- c2_match(ps, w, ps->o.focus_blacklist, NULL))) {
+ if (ps->o.wintype_option[w->window_type].focus) {
w->focused = true;
+ } else if (!ps->o.wintype_option[w->window_type].focus) {
+ w->focused = false;
+ }
+
+ if (ps, w, ps->o.focus_blacklist, NULL) {
+ log_warn("Focus exclude is deprecated. Please use either 'inactive-exclude' or 'active-exclude'");
}
// If window grouping detection is enabled, mark the window active if
@@ -1508,14 +1510,21 @@ static void win_determine_blur_background(session_t *ps, struct managed_win *w)
if (!ps->o.wintype_option[w->window_type].blur_background) {
log_debug("Blur background disabled by wintypes");
blur_background_new = false;
- } else if (c2_match(ps, w, ps->o.blur_background_blacklist, NULL)) {
- log_debug("Blur background disabled by "
- "blur-background-exclude");
- blur_background_new = false;
- } else if (c2_match(ps, w, ps->o.blur_rules, NULL)) {
- blur_background_new = true;
- } else {
- blur_background_new = false;
+ }
+ if (!ps->o.blur_whitelist) {
+ if (c2_match(ps, w, ps->o.blur_background_blacklist, NULL)) {
+ log_debug("Blur background disabled by "
+ "blur-exclude");
+ blur_background_new = false;
+ } else {
+ blur_background_new = true;
+ }
+ } else if (ps->o.blur_whitelist) {
+ if (c2_match(ps, w, ps->o.blur_rules, NULL)) {
+ blur_background_new = true;
+ } else {
+ blur_background_new = false;
+ }
}
}