~raphi/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH somebar 0/1] tag 0 is causing all other tags to be hidden.

Details
Message ID
<167225632334.7276.9057849508916083080-0@git.sr.ht>
DKIM signature
missing
Download raw message
hide-vacant-tags patch used to make all tags disappear when a certain
window is tagged with zero (all tags at once). This new patch doesn't
have that problem and behaves identically to the dwm patch it is trying
to mimic.

medanisjbara (1):
  hide-vacant-tags: fix tag 0 is hiding all

 contrib/hide-vacant-tags.patch | 54 +++++++++++++++++++++++-----------
 1 file changed, 37 insertions(+), 17 deletions(-)

-- 
2.34.5

[PATCH somebar 1/1] hide-vacant-tags: fix tag 0 is hiding all

Details
Message ID
<167225632334.7276.9057849508916083080-1@git.sr.ht>
In-Reply-To
<167225632334.7276.9057849508916083080-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
Patch: +37 -17
From: medanisjbara <anis2834133766619@gmail.com>

---
 contrib/hide-vacant-tags.patch | 54 +++++++++++++++++++++++-----------
 1 file changed, 37 insertions(+), 17 deletions(-)

diff --git a/contrib/hide-vacant-tags.patch b/contrib/hide-vacant-tags.patch
index 7d27ce1..055dd51 100644
--- a/contrib/hide-vacant-tags.patch
+++ b/contrib/hide-vacant-tags.patch
@@ -5,30 +5,50 @@ diff --git a/src/bar.cpp b/src/bar.cpp
index fab5a8f..38e7b5f 100644
--- a/src/bar.cpp
+++ b/src/bar.cpp
@@ -240,12 +240,22 @@ void Bar::render()
@@ -240,13 +240,36 @@ void Bar::render()
 
 void Bar::renderTags()
 {
+	bool focused;
+	// Check if all tags are active (Mod+0)
+	bool allActive = true;
 	for (auto &tag : _tags) {
-		setColorScheme(
-			tag.state & TagState::Active ? colorActive : colorInactive,
-			tag.state & TagState::Urgent);
-		renderComponent(tag.component);
+		focused = false;
 		auto indicators = std::min(tag.numClients, static_cast<int>(_bufs->height/2));
+		for (auto ind = 0; ind < indicators; ind++) {
+			if (tag.focusedClient){
+				focused = true;
+		if (tag.state & TagState::Active){
+			if (!allActive){
+				allActive = true;
+				break;
+			}
+			allActive = false;
+		}
+	}
+
+		if (tag.state & TagState::Active || focused){
+			setColorScheme(
+				tag.state & TagState::Active ? colorActive : colorInactive,
+				tag.state & TagState::Urgent);
+			renderComponent(tag.component);
+		}
+	bool renderThis;
+	for (auto &tag : _tags) {
+		renderThis = false;
 		setColorScheme(
 			tag.state & TagState::Active ? colorActive : colorInactive,
 			tag.state & TagState::Urgent);
-		renderComponent(tag.component);
+		// Reder active tag if it's the only one active
+		if (!allActive && tag.state & TagState::Active)
+			renderThis = true;
 		auto indicators = std::min(tag.numClients, static_cast<int>(_bufs->height/2));
 		for (auto ind = 0; ind < indicators; ind++) {
+			// render tags having indicators
+			if (tag.focusedClient == -1)
+				renderThis = true;
+			// render tags having the focused client
+			if (tag.focusedClient == 0){
+				renderThis = true;
+			}
 			auto w = ind == tag.focusedClient ? 7 : 1;
 			cairo_move_to(_painter, tag.component.x, ind*2+0.5);
 			cairo_rel_line_to(_painter, w, 0);
@@ -254,6 +277,8 @@ void Bar::renderTags()
 			cairo_set_line_width(_painter, 1);
 			cairo_stroke(_painter);
 		}
+		if (renderThis)
+			renderComponent(tag.component);
 	}
 }
 
-- 
2.34.5

[somebar/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CPDPF2SD4DTD.ZL6CEFU4BGG8@cirno>
In-Reply-To
<167225632334.7276.9057849508916083080-1@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
somebar/patches: SUCCESS in 1m10s

[tag 0 is causing all other tags to be hidden.][0] from [~jbara][1]

[0]: https://lists.sr.ht/~raphi/public-inbox/patches/37800
[1]: med.anis.jbara.2000@gmail.com

✓ #912771 SUCCESS somebar/patches/archlinux.yml https://builds.sr.ht/~raphi/job/912771
✓ #912772 SUCCESS somebar/patches/freebsd.yml   https://builds.sr.ht/~raphi/job/912772

Re: [PATCH somebar 1/1] hide-vacant-tags: fix tag 0 is hiding all

Details
Message ID
<7080cc6e-5c9a-41b7-a6b2-4e88463cdf98@app.fastmail.com>
In-Reply-To
<167225632334.7276.9057849508916083080-1@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
Thanks
To git.sr.ht:~raphi/somebar
   ea9dbfe..624e929  master -> master
Reply to thread Export thread (mbox)