hide_vacant_tags: update for bar 2024-04-14

This commit is contained in:
sewn 2024-04-14 07:59:38 +03:00
parent 0c8cc199dc
commit a20b75a9fd
No known key found for this signature in database

View File

@ -1,17 +1,17 @@
From 7350bdb548ba4b50a666a6e7fdc71d26c6e7e191 Mon Sep 17 00:00:00 2001 From 6337cf36554eda98f3d160ef4fdd12eb042f4120 Mon Sep 17 00:00:00 2001
From: sewn <sewn@disroot.org> From: sewn <sewn@disroot.org>
Date: Sun, 24 Mar 2024 23:07:11 +0300 Date: Sun, 14 Apr 2024 07:58:53 +0300
Subject: [PATCH] port hide vacant tags patch Subject: [PATCH] port hide vacant tags patch
--- ---
dwl.c | 26 +++++++++++++++++--------- dwl.c | 25 ++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-) 1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/dwl.c b/dwl.c diff --git a/dwl.c b/dwl.c
index 8341134..3332c69 100644 index 54273ae..7db6273 100644
--- a/dwl.c --- a/dwl.c
+++ b/dwl.c +++ b/dwl.c
@@ -652,7 +652,7 @@ void buffer_end_data_ptr_access(struct wlr_buffer *buffer) { @@ -651,7 +651,7 @@ void buffer_end_data_ptr_access(struct wlr_buffer *buffer) {
void void
buttonpress(struct wl_listener *listener, void *data) buttonpress(struct wl_listener *listener, void *data)
{ {
@ -20,14 +20,13 @@ index 8341134..3332c69 100644
unsigned int click; unsigned int click;
struct wlr_pointer_button_event *event = data; struct wlr_pointer_button_event *event = data;
struct wlr_keyboard *keyboard; struct wlr_keyboard *keyboard;
@@ -673,9 +673,18 @@ buttonpress(struct wl_listener *listener, void *data) @@ -672,9 +672,17 @@ buttonpress(struct wl_listener *listener, void *data)
if ((node = wlr_scene_node_at(&layers[LyrBottom]->node, cursor->x, cursor->y, NULL, NULL)) && if ((node = wlr_scene_node_at(&layers[LyrBottom]->node, cursor->x, cursor->y, NULL, NULL)) &&
(buffer = wlr_scene_buffer_from_node(node)) && buffer == selmon->scene_buffer) { (buffer = wlr_scene_buffer_from_node(node)) && buffer == selmon->scene_buffer) {
x = selmon->m.x; x = selmon->m.x;
- do - do
- x += TEXTW(tags[i]); - x += TEXTW(tags[i]);
- while (cursor->x >= x && ++i < LENGTH(tags)); - while (cursor->x >= x && ++i < LENGTH(tags));
+
+ wl_list_for_each(c, &clients, link) { + wl_list_for_each(c, &clients, link) {
+ if (c->mon != selmon) + if (c->mon != selmon)
+ continue; + continue;
@ -42,7 +41,7 @@ index 8341134..3332c69 100644
if (i < LENGTH(tags)) { if (i < LENGTH(tags)) {
click = ClkTagBar; click = ClkTagBar;
arg.ui = 1 << i; arg.ui = 1 << i;
@@ -1464,13 +1473,16 @@ drawbar(Monitor *mon) @@ -1379,13 +1387,16 @@ drawbar(Monitor *mon)
wl_list_for_each(c, &clients, link) { wl_list_for_each(c, &clients, link) {
if (c->mon != mon) if (c->mon != mon)
continue; continue;
@ -60,17 +59,17 @@ index 8341134..3332c69 100644
w = TEXTW(tags[i]); w = TEXTW(tags[i]);
sel = mon->tagset[mon->seltags] & 1 << i; sel = mon->tagset[mon->seltags] & 1 << i;
@@ -1479,10 +1491,6 @@ drawbar(Monitor *mon) @@ -1393,10 +1404,6 @@ drawbar(Monitor *mon)
draw_text(pix, x, 0, w, mon->b.height, lrpad / 2, tags[i], urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg),
urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg)); urg & 1 << i ? &selbarfg : (sel ? &selbarbg : &normbarbg));
- if (occ & 1 << i) - if (occ & 1 << i)
- draw_rect(pix, x + boxs, boxs, boxw, boxw, - drwl_rect(pix, x + boxs, boxs, boxw, boxw, sel,
- sel, urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg)); - urg & 1 << i ? &selbarbg : (sel ? &selbarfg : &normbarfg));
- -
x += w; x += w;
} }
w = TEXTW(mon->ltsymbol);
-- --
2.44.0 2.44.0