]> git.corax.cc Git - dwm/commitdiff
Draw the status bar on all screens
authorMatthias Kruk <m@m10k.eu>
Thu, 24 Dec 2020 13:19:34 +0000 (22:19 +0900)
committerMatthias Kruk <m@m10k.eu>
Thu, 24 Dec 2020 13:19:34 +0000 (22:19 +0900)
The status bar contains the clock and other information that should
be displayed on all screens. This commit makes sure it is drawn on
all screens, not just the selected one.

dwm.c

diff --git a/dwm.c b/dwm.c
index cf29259df7b24b48946d53c67e3d63e4bb37beaa..902b125a30dc3f268fe89732fed2e0f73c617e17 100755 (executable)
--- a/dwm.c
+++ b/dwm.c
@@ -852,20 +852,18 @@ drawbar(Monitor *m) {
        drawtext(m->ltsymbol, dc.norm, False);
        dc.x += dc.w;
        x = dc.x;
-       if(m == selmon) { /* status is only drawn on selected monitor */
-               dc.w = TEXTW(stext);
-               dc.x = m->ww - dc.w;
-               if(showsystray && m == selmon) {
-                       dc.x -= getsystraywidth();
-               }
-               if(dc.x < x) {
-                       dc.x = x;
-                       dc.w = m->ww - x;
-               }
-               drawtext(stext, dc.norm, False);
+
+       dc.w = TEXTW(stext);
+       dc.x = m->ww - dc.w;
+       if(showsystray && m == selmon) {
+               dc.x -= getsystraywidth();
        }
-       else
-               dc.x = m->ww;
+       if(dc.x < x) {
+               dc.x = x;
+               dc.w = m->ww - x;
+       }
+       drawtext(stext, dc.norm, False);
+
        if((dc.w = dc.x - x) > bh) {
                dc.x = x;
                if(m->sel) {