Discussion:
[dev] [dwm] [PATCH] Do not draw bar if it is hidden
Alexander Krotov
2018-08-06 13:42:19 UTC
Permalink
With this patch the bar can at least be hidden before opening web pages
that cause Xft errors.
Hiltjo Posthuma
2018-08-06 16:10:02 UTC
Permalink
Post by Alexander Krotov
With this patch the bar can at least be hidden before opening web pages
that cause Xft errors.
This is not a dwm issue. Please bother the Xft developers.
Post by Alexander Krotov
From b13c56c10b4c1da3e357efae3d4827da573650a4 Mon Sep 17 00:00:00 2001
Date: Mon, 6 Aug 2018 16:37:14 +0300
Subject: [PATCH] Do not draw bar if it is hidden
---
dwm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dwm.c b/dwm.c
index 4465af1..c7debe2 100644
--- a/dwm.c
+++ b/dwm.c
@@ -701,6 +701,9 @@ drawbar(Monitor *m)
unsigned int i, occ = 0, urg = 0;
Client *c;
+ if (!m->showbar)
+ return;
+
/* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
--
2.17.1
--
Kind regards,
Hiltjo
Petr Šabata
2018-08-06 17:01:20 UTC
Permalink
Post by Hiltjo Posthuma
Post by Alexander Krotov
With this patch the bar can at least be hidden before opening web pages
that cause Xft errors.
This is not a dwm issue. Please bother the Xft developers.
While true, there's also no point in executing the code if the
bar is hidden.

P
not experiencing the issue
Post by Hiltjo Posthuma
Post by Alexander Krotov
From b13c56c10b4c1da3e357efae3d4827da573650a4 Mon Sep 17 00:00:00 2001
Date: Mon, 6 Aug 2018 16:37:14 +0300
Subject: [PATCH] Do not draw bar if it is hidden
---
dwm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dwm.c b/dwm.c
index 4465af1..c7debe2 100644
--- a/dwm.c
+++ b/dwm.c
@@ -701,6 +701,9 @@ drawbar(Monitor *m)
unsigned int i, occ = 0, urg = 0;
Client *c;
+ if (!m->showbar)
+ return;
+
/* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
--
2.17.1
--
Kind regards,
Hiltjo
David Demelier
2018-08-07 07:16:10 UTC
Permalink
Post by Petr Å abata
Post by Hiltjo Posthuma
This is not a dwm issue. Please bother the Xft developers.
While true, there's also no point in executing the code if the
bar is hidden.
Completely second that.
--
David
Silvan Jegen
2018-08-07 08:55:22 UTC
Permalink
Hi Alexander
Post by Alexander Krotov
With this patch the bar can at least be hidden before opening web pages
that cause Xft errors.
Looks good to me!

There is no reason to draw the bar if you don't want to show it.


Cheers,

Silvan
Laslo Hunhold
2018-08-07 09:45:05 UTC
Permalink
On Mon, 6 Aug 2018 16:42:19 +0300
Alexander Krotov <***@gmail.com> wrote:

Dear Alexander,
Post by Alexander Krotov
With this patch the bar can at least be hidden before opening web
pages that cause Xft errors.
I agree with the patch, but not because of the Xft bug. We should just
not execute code that is unnecessary.

Maybe we can layer this check out though and do a

if (m->showbar) {
drawbar(...)
}

What do you guys think?

With best regards

Laslo
--
Laslo Hunhold <***@frign.de>
Silvan Jegen
2018-08-07 13:47:59 UTC
Permalink
Post by Laslo Hunhold
On Mon, 6 Aug 2018 16:42:19 +0300
Dear Alexander,
Post by Alexander Krotov
With this patch the bar can at least be hidden before opening web
pages that cause Xft errors.
I agree with the patch, but not because of the Xft bug. We should just
not execute code that is unnecessary.
Maybe we can layer this check out though and do a
if (m->showbar) {
drawbar(...)
}
What do you guys think?
I don't mind either way as long as we don't execute code that we don't need.

Only calling drawbar() when we actually want to show the bar would
make the intent clearer.


Cheers,

Silvan
Cág
2018-08-07 18:24:34 UTC
Permalink
Post by Laslo Hunhold
Maybe we can layer this check out though and do a
if (m->showbar) {
drawbar(...)
}
What do you guys think?
+1

--
caóc
Alexander Krotov
2018-08-08 11:02:36 UTC
Permalink
Post by Laslo Hunhold
On Mon, 6 Aug 2018 16:42:19 +0300
Dear Alexander,
Post by Alexander Krotov
With this patch the bar can at least be hidden before opening web
pages that cause Xft errors.
I agree with the patch, but not because of the Xft bug. We should just
not execute code that is unnecessary.
It is not a solution for Xft bug ofc.
Post by Laslo Hunhold
Maybe we can layer this check out though and do a
if (m->showbar) {
drawbar(...)
}
What do you guys think?
Ok, makes sense.
Post by Laslo Hunhold
With best regards
Laslo
Loading...