aboutsummaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-12-24 14:38:57 +0100
committerJoe <rbo@gmx.us>2024-12-24 14:38:57 +0100
commit0b402ddabf4236bddb580f39733004440a7ede63 (patch)
tree1183dac1839b031ad9ef7618763d9fc94911f7bc /dwm.c
parentstatus2d (diff)
downloaddwm-0b402ddabf4236bddb580f39733004440a7ede63.tar.gz
dwm-0b402ddabf4236bddb580f39733004440a7ede63.tar.bz2
dwm-0b402ddabf4236bddb580f39733004440a7ede63.tar.xz
dwm-0b402ddabf4236bddb580f39733004440a7ede63.tar.zst
dwm-0b402ddabf4236bddb580f39733004440a7ede63.zip
up
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c50
1 files changed, 5 insertions, 45 deletions
diff --git a/dwm.c b/dwm.c
index 88f4f58..eec383a 100644
--- a/dwm.c
+++ b/dwm.c
@@ -88,7 +88,7 @@ enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
enum { Manager, Xembed, XembedInfo, XLast }; /* Xembed atoms */
enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
-enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
+enum { ClkTagBar, ClkLtSymbol, ClkStatusText,
ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
typedef union {
@@ -630,10 +630,8 @@ buttonpress(XEvent *e)
}
else if (ev->x < x + TEXTW(selmon->ltsymbol) + columns * bh / tagrows)
click = ClkLtSymbol;
- else if (ev->x > selmon->ww - (int)TEXTW(stext) - getsystraywidth())
- click = ClkStatusText;
else
- click = ClkWinTitle;
+ click = ClkStatusText;
} else if ((c = wintoclient(ev->window))) {
if (focusonwheel || (ev->button != Button4 && ev->button != Button5))
focus(c);
@@ -1131,10 +1129,10 @@ dirtomon(int dir)
void
drawbar(Monitor *m)
{
- int x, w, tw = 0, mw, ew = 0, stw = 0;
+ int x, w, tw = 0, stw = 0;
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
- unsigned int i, occ = 0, urg = 0, n = 0;
+ unsigned int i, occ = 0, urg = 0;
Client *c;
if (!m->showbar)
@@ -1150,8 +1148,6 @@ drawbar(Monitor *m)
resizebarwin(m);
for (c = m->clients; c; c = c->next) {
- if (ISVISIBLE(c))
- n++;
occ |= c->tags;
if (c->isurgent)
urg |= c->tags;
@@ -1176,39 +1172,6 @@ drawbar(Monitor *m)
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
if ((w = m->ww - tw - stw - x) > bh) {
- if (n > 0) {
- tw = TEXTW(m->sel->name) + lrpad;
- mw = (tw >= w || n == 1) ? 0 : (w - tw) / (n - 1);
-
- i = 0;
- for (c = m->clients; c; c = c->next) {
- if (!ISVISIBLE(c) || c == m->sel)
- continue;
- tw = TEXTW(c->name);
- if(tw < mw)
- ew += (mw - tw);
- else
- i++;
- }
- if (i > 0)
- mw += ew / i;
-
- for (c = m->clients; c; c = c->next) {
- if (!ISVISIBLE(c))
- continue;
- tw = MIN(m->sel == c ? w : mw, TEXTW(c->name));
-
- drw_setscheme(drw, scheme[SchemeNorm]);
- if (tw > lrpad / 2)
- drw_text(drw, x, text_ypos, tw, bh, lrpad / 2, c->name, 0);
- drw_setscheme(drw, scheme[m == selmon && m->sel == c ? SchemeSel : SchemeNorm]);
- drw_rect(drw, x , bh - brdsh_ypos , tw , brdsh_w , 1, 1);
- if (c->isfloating)
- drw_rect(drw, x + boxs, boxs, boxw, boxw, c->isfixed, 0);
- x += tw;
- w -= tw;
- }
- }
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x, 0, w, bh, 1, 1);
}
@@ -2038,11 +2001,8 @@ propertynotify(XEvent *e)
drawbars();
break;
}
- if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
+ if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName])
updatetitle(c);
- if (c == c->mon->sel)
- drawbar(c->mon);
- }
if (ev->atom == netatom[NetWMWindowType])
updatewindowtype(c);
}