aboutsummaryrefslogtreecommitdiff
path: root/src/win.c
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/win.c
parentUpdate README.md (diff)
downloadcompfy-a51f4229715d3edc4c4b609764cc9328d9940232.tar.xz
compfy-a51f4229715d3edc4c4b609764cc9328d9940232.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/win.c')
-rw-r--r--src/win.c35
1 files changed, 22 insertions, 13 deletions
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;
+ }
}
}