aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h2
-rw-r--r--dwm.c28
2 files changed, 10 insertions, 20 deletions
diff --git a/config.h b/config.h
index 5293939..9d05af4 100644
--- a/config.h
+++ b/config.h
@@ -146,10 +146,10 @@ static Button buttons[] = {
146 /* click event mask button function argument */ 146 /* click event mask button function argument */
147 { ClkLtSymbol, 0, Button1, setlayout, {0} }, 147 { ClkLtSymbol, 0, Button1, setlayout, {0} },
148 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[5]}}, 148 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[5]}},
149 { ClkWinTitle, 0, Button2, zoom, {0} },
150 { ClkStatusText, 0, Button1, sigstatusbar, {.i = 1} }, 149 { ClkStatusText, 0, Button1, sigstatusbar, {.i = 1} },
151 { ClkStatusText, 0, Button2, sigstatusbar, {.i = 2} }, 150 { ClkStatusText, 0, Button2, sigstatusbar, {.i = 2} },
152 { ClkStatusText, 0, Button3, sigstatusbar, {.i = 3} }, 151 { ClkStatusText, 0, Button3, sigstatusbar, {.i = 3} },
152 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
153 { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 153 { ClkClientWin, MODKEY, Button1, movemouse, {0} },
154 { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 154 { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
155 { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 155 { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
diff --git a/dwm.c b/dwm.c
index df84af1..c983b33 100644
--- a/dwm.c
+++ b/dwm.c
@@ -68,8 +68,8 @@ enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
68 NetWMFullscreen, NetActiveWindow, NetWMWindowType, 68 NetWMFullscreen, NetActiveWindow, NetWMWindowType,
69 NetWMWindowTypeDialog, NetClientList, NetClientInfo, NetLast }; /* EWMH atoms */ 69 NetWMWindowTypeDialog, NetClientList, NetClientInfo, NetLast }; /* EWMH atoms */
70enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ 70enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
71enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, 71enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkClientWin,
72 ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ 72 ClkRootWin, ClkLast }; /* clicks */
73 73
74typedef union { 74typedef union {
75 int i; 75 int i;
@@ -531,9 +531,11 @@ buttonpress(XEvent *e)
531 arg.ui = 1 << i; 531 arg.ui = 1 << i;
532 } else if (ev->x < x + blw) 532 } else if (ev->x < x + blw)
533 click = ClkLtSymbol; 533 click = ClkLtSymbol;
534 else if (ev->x > selmon->ww - statusw) { 534 else
535 x = selmon->ww - statusw;
536 click = ClkStatusText; 535 click = ClkStatusText;
536 } else if ((c = wintoclient(ev->window))) {
537 focus(c);
538 restack(selmon);
537 statussig = 0; 539 statussig = 0;
538 for (text = s = stext; *s && x <= ev->x; s++) { 540 for (text = s = stext; *s && x <= ev->x; s++) {
539 if ((unsigned char)(*s) < ' ') { 541 if ((unsigned char)(*s) < ' ') {
@@ -547,8 +549,6 @@ buttonpress(XEvent *e)
547 statussig = ch; 549 statussig = ch;
548 } 550 }
549 } 551 }
550 } else
551 click = ClkWinTitle;
552 } else if ((c = wintoclient(ev->window))) { 552 } else if ((c = wintoclient(ev->window))) {
553 focus(c); 553 focus(c);
554 restack(selmon); 554 restack(selmon);
@@ -868,15 +868,8 @@ drawbar(Monitor *m)
868 x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); 868 x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
869 869
870 if ((w = m->ww - sw - x) > bh) { 870 if ((w = m->ww - sw - x) > bh) {
871 if (m->sel) { 871 drw_setscheme(drw, scheme[SchemeNorm]);
872 drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); 872 drw_rect(drw, x, 0, w - 2 * sp, bh, 1, 1);
873 drw_text(drw, x, 0, w - 2 * sp, bh, lrpad / 2, m->sel->name, 0);
874 if (m->sel->isfloating)
875 drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
876 } else {
877 drw_setscheme(drw, scheme[SchemeNorm]);
878 drw_rect(drw, x, 0, w - 2 * sp, bh, 1, 1);
879 }
880 } 873 }
881 drw_map(drw, m->barwin, 0, 0, m->ww, bh); 874 drw_map(drw, m->barwin, 0, 0, m->ww, bh);
882} 875}
@@ -1422,11 +1415,8 @@ propertynotify(XEvent *e)
1422 drawbars(); 1415 drawbars();
1423 break; 1416 break;
1424 } 1417 }
1425 if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { 1418 if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName])
1426 updatetitle(c); 1419 updatetitle(c);
1427 if (c == c->mon->sel)
1428 drawbar(c->mon);
1429 }
1430 if (ev->atom == netatom[NetWMWindowType]) 1420 if (ev->atom == netatom[NetWMWindowType])
1431 updatewindowtype(c); 1421 updatewindowtype(c);
1432 } 1422 }