From 62939ce289391213a5a5bd55567b26b3221b2b92 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Tue, 7 May 2024 21:50:38 +0200 Subject: [PATCH] fix: correct behavior with other patches that change VISIBLEON This fixes problems with patches like istticky, where the sticky window would be visible on every monitor. It's not. It should be visible only on its monitor. SVIBISLBEON should always be adapted with those patches. It's used just for singletagset when looking where a window should be visible --- dwl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index e1ee2d8..ed748e5 100644 --- a/dwl.c +++ b/dwl.c @@ -71,7 +71,8 @@ #define MIN(A, B) ((A) < (B) ? (A) : (B)) #define ROUND(X) ((int)((X < 0) ? (X - 0.5) : (X + 0.5))) #define CLEANMASK(mask) (mask & ~WLR_MODIFIER_CAPS) -#define VISIBLEON(C, M) ((M) && (C)->mon && ((C)->tags & (M)->tagset[(M)->seltags])) +#define VISIBLEON(C, M) ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags])) +#define SVISIBLEON(C, M) ((M) && (C)->mon && ((C)->tags & (M)->tagset[(M)->seltags])) #define LENGTH(X) (sizeof X / sizeof X[0]) #define END(A) ((A) + LENGTH(A)) #define TAGMASK ((1u << TAGCOUNT) - 1) @@ -579,7 +580,7 @@ attachclients(Monitor *m) } wl_list_for_each(c, &clients, link) { - if (VISIBLEON(c, m)) { + if (SVISIBLEON(c, m)) { /* if client is also visible on other tags that are displayed on * other monitors, remove these tags */ if (c->tags & utags) { -- 2.49.0