sipi / dwm-status2d

patch for DWM that allows colors and draw rectangle in the DWM status bar
GNU General Public License v3.0
20 stars 3 forks source link

slstatus disappears after this patch is installed #5

Closed mtwb47 closed 2 weeks ago

mtwb47 commented 3 years ago

For whatever reason, slstatus just simply disappears after this patch is applied to dwm.c.

I've done it twice now. First I patched using the normal automated method. After resolving some conflicts, dwm built fine only with errors of unused variables and such. After a restart of dwm, slstatus was gone. So I reverted to dwm prior to the patch, and on the advice of someone who had the same problem on Reddit, I patched dwm manually. The same thing happened.

I did notice while going through and manually applying the patch, that there were a couple of discrepancies, which may be the problem I'm experiencing.

This is code from the patch.


@@ -701,9 +802,7 @@ drawbar(Monitor *m)

    /* 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]);
-       sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
-       drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0);
+       sw = m->ww - drawstatusbar(m, bh, stext);
    }

Mine is the same except

sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */

is

tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */

I'm not sure what the ramifications of sw being tw in the original, but I thought I'd throw it out there.

These are the current patches I've applied to dwm:

alwayscenter attachbottom autostart fullgaps movestack pertag restartsig statusallmons statuscmd warp

I'm assuming that the issue is some conflict with an existing patch.

lhark commented 3 years ago

In the diff you show, status2d replaces the original status bar drawing code by a call to drawstatusbar. The thing to note also is that sw is the computed status bar width. I don't know where your tw comes from, in my dwm it is introduced by the fancybar patch, so have a look through your patches.

The thing to note is that usually the *w variables represent a width, and are used to position element in relation to the right of the monitor. If in your case the computation is off, it is possible that your status bar is overwritten by another element or drawn outside the monitor.

I cannot really help you as your patch setup is pretty far from mine. But once you start piling a lot a patches on the same component, it become inevitable that you have to dive in and actually understand the drawing code.

Good luck !

On 12/12/20 08:05, mtwb47 wrote:

For whatever reason, slstatus just simply disappears after this patch is applied to dwm.c.

I've done it twice now. First I patched using the normal automated method. After resolving some conflicts, dwm built fine only with errors of unused variables and such. After a restart of dwm, slstatus was gone. So I reverted to dwm prior to the patch, and on the advice of someone who had the same problem on Reddit, I patched dwm manually. The same thing happened.

I did notice while going through and manually applying the patch, that there were a couple of discrepancies, which may be the probelm I'm experiencing.

This is code from the patch.


@@ -701,9 +802,7 @@ drawbar(Monitor *m)

  /* 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]);
-     sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
-     drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0);
+     sw = m->ww - drawstatusbar(m, bh, stext);
  }

Min is the same except

sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */

is

tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */

I'm not sure what the ramifications of sw being tw in the original, but I thought I'd throw it out there.

These are the current patches I've applied to dwm:

alwayscenter attachbottom autostart fullgaps movestack pertag restartsig statusallmons statuscmd warp

I'm assuming that the issue is some conflict with an existing patch.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/sipi/dwm-status2d/issues/5

sipi commented 2 weeks ago

Sorry but I can't handle all patch mix :) Close because it's been a while and more related to patch management.